From 81bb3b2618f66216138750322f09e26a6ec153f7 Mon Sep 17 00:00:00 2001 From: Nex Date: Tue, 11 Sep 2018 22:31:21 +0800 Subject: [PATCH] Add generated Java classes --- .../bdchain/api/grpc/AccountingChainGrpc.java | 655 +++++++ .../api/grpc/AccountingChainProto.java | 185 ++ src/main/java/bdchain/api/grpc/Block.java | 1568 +++++++++++++++++ .../bdchain/api/grpc/BlockNumberRequest.java | 541 ++++++ .../api/grpc/BlockNumberRequestOrBuilder.java | 19 + .../bdchain/api/grpc/BlockNumberResponse.java | 473 +++++ .../grpc/BlockNumberResponseOrBuilder.java | 14 + .../java/bdchain/api/grpc/BlockOrBuilder.java | 141 ++ .../java/bdchain/api/grpc/CommonProto.java | 47 + .../bdchain/api/grpc/CreateLedgerRequest.java | 541 ++++++ .../grpc/CreateLedgerRequestOrBuilder.java | 19 + .../api/grpc/CreateLedgerResponse.java | 473 +++++ .../grpc/CreateLedgerResponseOrBuilder.java | 14 + .../api/grpc/GetBlockByHashRequest.java | 661 +++++++ .../grpc/GetBlockByHashRequestOrBuilder.java | 29 + .../api/grpc/GetBlockByNumberRequest.java | 659 +++++++ .../GetBlockByNumberRequestOrBuilder.java | 29 + .../bdchain/api/grpc/GetLedgersResponse.java | 586 ++++++ .../api/grpc/GetLedgersResponseOrBuilder.java | 28 + ...TransactionByBlockHashAndIndexRequest.java | 660 +++++++ ...onByBlockHashAndIndexRequestOrBuilder.java | 29 + ...ansactionByBlockNumberAndIndexRequest.java | 658 +++++++ ...ByBlockNumberAndIndexRequestOrBuilder.java | 29 + .../api/grpc/GetTransactionByHashRequest.java | 602 +++++++ .../GetTransactionByHashRequestOrBuilder.java | 24 + .../api/grpc/SendTransactionRequest.java | 1427 +++++++++++++++ .../grpc/SendTransactionRequestOrBuilder.java | 32 + .../api/grpc/SendTransactionResponse.java | 475 +++++ .../SendTransactionResponseOrBuilder.java | 14 + .../java/bdchain/api/grpc/Transaction.java | 1367 ++++++++++++++ .../api/grpc/TransactionLedgerGrpc.java | 430 +++++ .../api/grpc/TransactionLedgerProto.java | 133 ++ .../api/grpc/TransactionOrBuilder.java | 125 ++ .../bdchain/api/grpc/TransactionType.java | 157 ++ src/main/java/com/google/protobuf/Empty.java | 433 +++++ .../com/google/protobuf/EmptyOrBuilder.java | 9 + .../java/com/google/protobuf/EmptyProto.java | 58 + 37 files changed, 13344 insertions(+) create mode 100644 src/main/java/bdchain/api/grpc/AccountingChainGrpc.java create mode 100644 src/main/java/bdchain/api/grpc/AccountingChainProto.java create mode 100644 src/main/java/bdchain/api/grpc/Block.java create mode 100644 src/main/java/bdchain/api/grpc/BlockNumberRequest.java create mode 100644 src/main/java/bdchain/api/grpc/BlockNumberRequestOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/BlockNumberResponse.java create mode 100644 src/main/java/bdchain/api/grpc/BlockNumberResponseOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/BlockOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/CommonProto.java create mode 100644 src/main/java/bdchain/api/grpc/CreateLedgerRequest.java create mode 100644 src/main/java/bdchain/api/grpc/CreateLedgerRequestOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/CreateLedgerResponse.java create mode 100644 src/main/java/bdchain/api/grpc/CreateLedgerResponseOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/GetBlockByHashRequest.java create mode 100644 src/main/java/bdchain/api/grpc/GetBlockByHashRequestOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/GetBlockByNumberRequest.java create mode 100644 src/main/java/bdchain/api/grpc/GetBlockByNumberRequestOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/GetLedgersResponse.java create mode 100644 src/main/java/bdchain/api/grpc/GetLedgersResponseOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/GetTransactionByBlockHashAndIndexRequest.java create mode 100644 src/main/java/bdchain/api/grpc/GetTransactionByBlockHashAndIndexRequestOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/GetTransactionByBlockNumberAndIndexRequest.java create mode 100644 src/main/java/bdchain/api/grpc/GetTransactionByBlockNumberAndIndexRequestOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/GetTransactionByHashRequest.java create mode 100644 src/main/java/bdchain/api/grpc/GetTransactionByHashRequestOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/SendTransactionRequest.java create mode 100644 src/main/java/bdchain/api/grpc/SendTransactionRequestOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/SendTransactionResponse.java create mode 100644 src/main/java/bdchain/api/grpc/SendTransactionResponseOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/Transaction.java create mode 100644 src/main/java/bdchain/api/grpc/TransactionLedgerGrpc.java create mode 100644 src/main/java/bdchain/api/grpc/TransactionLedgerProto.java create mode 100644 src/main/java/bdchain/api/grpc/TransactionOrBuilder.java create mode 100644 src/main/java/bdchain/api/grpc/TransactionType.java create mode 100644 src/main/java/com/google/protobuf/Empty.java create mode 100644 src/main/java/com/google/protobuf/EmptyOrBuilder.java create mode 100644 src/main/java/com/google/protobuf/EmptyProto.java diff --git a/src/main/java/bdchain/api/grpc/AccountingChainGrpc.java b/src/main/java/bdchain/api/grpc/AccountingChainGrpc.java new file mode 100644 index 0000000..e83b88a --- /dev/null +++ b/src/main/java/bdchain/api/grpc/AccountingChainGrpc.java @@ -0,0 +1,655 @@ +package bdchain.api.grpc; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.14.0)", + comments = "Source: bdchain/api/ac_chain.proto") +public final class AccountingChainGrpc { + + private AccountingChainGrpc() {} + + public static final String SERVICE_NAME = "bdchain.api.AccountingChain"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getBlockNumberMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BlockNumber", + requestType = bdchain.api.grpc.BlockNumberRequest.class, + responseType = bdchain.api.grpc.BlockNumberResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getBlockNumberMethod() { + io.grpc.MethodDescriptor getBlockNumberMethod; + if ((getBlockNumberMethod = AccountingChainGrpc.getBlockNumberMethod) == null) { + synchronized (AccountingChainGrpc.class) { + if ((getBlockNumberMethod = AccountingChainGrpc.getBlockNumberMethod) == null) { + AccountingChainGrpc.getBlockNumberMethod = getBlockNumberMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "bdchain.api.AccountingChain", "BlockNumber")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.BlockNumberRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.BlockNumberResponse.getDefaultInstance())) + .setSchemaDescriptor(new AccountingChainMethodDescriptorSupplier("BlockNumber")) + .build(); + } + } + } + return getBlockNumberMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetBlockByNumberMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBlockByNumber", + requestType = bdchain.api.grpc.GetBlockByNumberRequest.class, + responseType = bdchain.api.grpc.Block.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetBlockByNumberMethod() { + io.grpc.MethodDescriptor getGetBlockByNumberMethod; + if ((getGetBlockByNumberMethod = AccountingChainGrpc.getGetBlockByNumberMethod) == null) { + synchronized (AccountingChainGrpc.class) { + if ((getGetBlockByNumberMethod = AccountingChainGrpc.getGetBlockByNumberMethod) == null) { + AccountingChainGrpc.getGetBlockByNumberMethod = getGetBlockByNumberMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "bdchain.api.AccountingChain", "GetBlockByNumber")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.GetBlockByNumberRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.Block.getDefaultInstance())) + .setSchemaDescriptor(new AccountingChainMethodDescriptorSupplier("GetBlockByNumber")) + .build(); + } + } + } + return getGetBlockByNumberMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetBlockByHashMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBlockByHash", + requestType = bdchain.api.grpc.GetBlockByHashRequest.class, + responseType = bdchain.api.grpc.Block.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetBlockByHashMethod() { + io.grpc.MethodDescriptor getGetBlockByHashMethod; + if ((getGetBlockByHashMethod = AccountingChainGrpc.getGetBlockByHashMethod) == null) { + synchronized (AccountingChainGrpc.class) { + if ((getGetBlockByHashMethod = AccountingChainGrpc.getGetBlockByHashMethod) == null) { + AccountingChainGrpc.getGetBlockByHashMethod = getGetBlockByHashMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "bdchain.api.AccountingChain", "GetBlockByHash")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.GetBlockByHashRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.Block.getDefaultInstance())) + .setSchemaDescriptor(new AccountingChainMethodDescriptorSupplier("GetBlockByHash")) + .build(); + } + } + } + return getGetBlockByHashMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetTransactionByHashMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTransactionByHash", + requestType = bdchain.api.grpc.GetTransactionByHashRequest.class, + responseType = bdchain.api.grpc.Block.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetTransactionByHashMethod() { + io.grpc.MethodDescriptor getGetTransactionByHashMethod; + if ((getGetTransactionByHashMethod = AccountingChainGrpc.getGetTransactionByHashMethod) == null) { + synchronized (AccountingChainGrpc.class) { + if ((getGetTransactionByHashMethod = AccountingChainGrpc.getGetTransactionByHashMethod) == null) { + AccountingChainGrpc.getGetTransactionByHashMethod = getGetTransactionByHashMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "bdchain.api.AccountingChain", "GetTransactionByHash")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.GetTransactionByHashRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.Block.getDefaultInstance())) + .setSchemaDescriptor(new AccountingChainMethodDescriptorSupplier("GetTransactionByHash")) + .build(); + } + } + } + return getGetTransactionByHashMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetTransactionByBlockNumberAndIndexMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTransactionByBlockNumberAndIndex", + requestType = bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest.class, + responseType = bdchain.api.grpc.Transaction.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetTransactionByBlockNumberAndIndexMethod() { + io.grpc.MethodDescriptor getGetTransactionByBlockNumberAndIndexMethod; + if ((getGetTransactionByBlockNumberAndIndexMethod = AccountingChainGrpc.getGetTransactionByBlockNumberAndIndexMethod) == null) { + synchronized (AccountingChainGrpc.class) { + if ((getGetTransactionByBlockNumberAndIndexMethod = AccountingChainGrpc.getGetTransactionByBlockNumberAndIndexMethod) == null) { + AccountingChainGrpc.getGetTransactionByBlockNumberAndIndexMethod = getGetTransactionByBlockNumberAndIndexMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "bdchain.api.AccountingChain", "GetTransactionByBlockNumberAndIndex")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.Transaction.getDefaultInstance())) + .setSchemaDescriptor(new AccountingChainMethodDescriptorSupplier("GetTransactionByBlockNumberAndIndex")) + .build(); + } + } + } + return getGetTransactionByBlockNumberAndIndexMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetTransactionByBlockHashAndIndexMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTransactionByBlockHashAndIndex", + requestType = bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest.class, + responseType = bdchain.api.grpc.Transaction.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetTransactionByBlockHashAndIndexMethod() { + io.grpc.MethodDescriptor getGetTransactionByBlockHashAndIndexMethod; + if ((getGetTransactionByBlockHashAndIndexMethod = AccountingChainGrpc.getGetTransactionByBlockHashAndIndexMethod) == null) { + synchronized (AccountingChainGrpc.class) { + if ((getGetTransactionByBlockHashAndIndexMethod = AccountingChainGrpc.getGetTransactionByBlockHashAndIndexMethod) == null) { + AccountingChainGrpc.getGetTransactionByBlockHashAndIndexMethod = getGetTransactionByBlockHashAndIndexMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "bdchain.api.AccountingChain", "GetTransactionByBlockHashAndIndex")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.Transaction.getDefaultInstance())) + .setSchemaDescriptor(new AccountingChainMethodDescriptorSupplier("GetTransactionByBlockHashAndIndex")) + .build(); + } + } + } + return getGetTransactionByBlockHashAndIndexMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static AccountingChainStub newStub(io.grpc.Channel channel) { + return new AccountingChainStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AccountingChainBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new AccountingChainBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static AccountingChainFutureStub newFutureStub( + io.grpc.Channel channel) { + return new AccountingChainFutureStub(channel); + } + + /** + */ + public static abstract class AccountingChainImplBase implements io.grpc.BindableService { + + /** + */ + public void blockNumber(bdchain.api.grpc.BlockNumberRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getBlockNumberMethod(), responseObserver); + } + + /** + */ + public void getBlockByNumber(bdchain.api.grpc.GetBlockByNumberRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetBlockByNumberMethod(), responseObserver); + } + + /** + */ + public void getBlockByHash(bdchain.api.grpc.GetBlockByHashRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetBlockByHashMethod(), responseObserver); + } + + /** + */ + public void getTransactionByHash(bdchain.api.grpc.GetTransactionByHashRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetTransactionByHashMethod(), responseObserver); + } + + /** + */ + public void getTransactionByBlockNumberAndIndex(bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetTransactionByBlockNumberAndIndexMethod(), responseObserver); + } + + /** + */ + public void getTransactionByBlockHashAndIndex(bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetTransactionByBlockHashAndIndexMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getBlockNumberMethod(), + asyncUnaryCall( + new MethodHandlers< + bdchain.api.grpc.BlockNumberRequest, + bdchain.api.grpc.BlockNumberResponse>( + this, METHODID_BLOCK_NUMBER))) + .addMethod( + getGetBlockByNumberMethod(), + asyncUnaryCall( + new MethodHandlers< + bdchain.api.grpc.GetBlockByNumberRequest, + bdchain.api.grpc.Block>( + this, METHODID_GET_BLOCK_BY_NUMBER))) + .addMethod( + getGetBlockByHashMethod(), + asyncUnaryCall( + new MethodHandlers< + bdchain.api.grpc.GetBlockByHashRequest, + bdchain.api.grpc.Block>( + this, METHODID_GET_BLOCK_BY_HASH))) + .addMethod( + getGetTransactionByHashMethod(), + asyncUnaryCall( + new MethodHandlers< + bdchain.api.grpc.GetTransactionByHashRequest, + bdchain.api.grpc.Block>( + this, METHODID_GET_TRANSACTION_BY_HASH))) + .addMethod( + getGetTransactionByBlockNumberAndIndexMethod(), + asyncUnaryCall( + new MethodHandlers< + bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest, + bdchain.api.grpc.Transaction>( + this, METHODID_GET_TRANSACTION_BY_BLOCK_NUMBER_AND_INDEX))) + .addMethod( + getGetTransactionByBlockHashAndIndexMethod(), + asyncUnaryCall( + new MethodHandlers< + bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest, + bdchain.api.grpc.Transaction>( + this, METHODID_GET_TRANSACTION_BY_BLOCK_HASH_AND_INDEX))) + .build(); + } + } + + /** + */ + public static final class AccountingChainStub extends io.grpc.stub.AbstractStub { + private AccountingChainStub(io.grpc.Channel channel) { + super(channel); + } + + private AccountingChainStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccountingChainStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new AccountingChainStub(channel, callOptions); + } + + /** + */ + public void blockNumber(bdchain.api.grpc.BlockNumberRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getBlockNumberMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getBlockByNumber(bdchain.api.grpc.GetBlockByNumberRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetBlockByNumberMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getBlockByHash(bdchain.api.grpc.GetBlockByHashRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetBlockByHashMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getTransactionByHash(bdchain.api.grpc.GetTransactionByHashRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetTransactionByHashMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getTransactionByBlockNumberAndIndex(bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetTransactionByBlockNumberAndIndexMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getTransactionByBlockHashAndIndex(bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetTransactionByBlockHashAndIndexMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class AccountingChainBlockingStub extends io.grpc.stub.AbstractStub { + private AccountingChainBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private AccountingChainBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccountingChainBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new AccountingChainBlockingStub(channel, callOptions); + } + + /** + */ + public bdchain.api.grpc.BlockNumberResponse blockNumber(bdchain.api.grpc.BlockNumberRequest request) { + return blockingUnaryCall( + getChannel(), getBlockNumberMethod(), getCallOptions(), request); + } + + /** + */ + public bdchain.api.grpc.Block getBlockByNumber(bdchain.api.grpc.GetBlockByNumberRequest request) { + return blockingUnaryCall( + getChannel(), getGetBlockByNumberMethod(), getCallOptions(), request); + } + + /** + */ + public bdchain.api.grpc.Block getBlockByHash(bdchain.api.grpc.GetBlockByHashRequest request) { + return blockingUnaryCall( + getChannel(), getGetBlockByHashMethod(), getCallOptions(), request); + } + + /** + */ + public bdchain.api.grpc.Block getTransactionByHash(bdchain.api.grpc.GetTransactionByHashRequest request) { + return blockingUnaryCall( + getChannel(), getGetTransactionByHashMethod(), getCallOptions(), request); + } + + /** + */ + public bdchain.api.grpc.Transaction getTransactionByBlockNumberAndIndex(bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest request) { + return blockingUnaryCall( + getChannel(), getGetTransactionByBlockNumberAndIndexMethod(), getCallOptions(), request); + } + + /** + */ + public bdchain.api.grpc.Transaction getTransactionByBlockHashAndIndex(bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest request) { + return blockingUnaryCall( + getChannel(), getGetTransactionByBlockHashAndIndexMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class AccountingChainFutureStub extends io.grpc.stub.AbstractStub { + private AccountingChainFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private AccountingChainFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccountingChainFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new AccountingChainFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture blockNumber( + bdchain.api.grpc.BlockNumberRequest request) { + return futureUnaryCall( + getChannel().newCall(getBlockNumberMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getBlockByNumber( + bdchain.api.grpc.GetBlockByNumberRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetBlockByNumberMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getBlockByHash( + bdchain.api.grpc.GetBlockByHashRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetBlockByHashMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getTransactionByHash( + bdchain.api.grpc.GetTransactionByHashRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetTransactionByHashMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getTransactionByBlockNumberAndIndex( + bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetTransactionByBlockNumberAndIndexMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getTransactionByBlockHashAndIndex( + bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetTransactionByBlockHashAndIndexMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_BLOCK_NUMBER = 0; + private static final int METHODID_GET_BLOCK_BY_NUMBER = 1; + private static final int METHODID_GET_BLOCK_BY_HASH = 2; + private static final int METHODID_GET_TRANSACTION_BY_HASH = 3; + private static final int METHODID_GET_TRANSACTION_BY_BLOCK_NUMBER_AND_INDEX = 4; + private static final int METHODID_GET_TRANSACTION_BY_BLOCK_HASH_AND_INDEX = 5; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AccountingChainImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AccountingChainImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_BLOCK_NUMBER: + serviceImpl.blockNumber((bdchain.api.grpc.BlockNumberRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_BLOCK_BY_NUMBER: + serviceImpl.getBlockByNumber((bdchain.api.grpc.GetBlockByNumberRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_BLOCK_BY_HASH: + serviceImpl.getBlockByHash((bdchain.api.grpc.GetBlockByHashRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_TRANSACTION_BY_HASH: + serviceImpl.getTransactionByHash((bdchain.api.grpc.GetTransactionByHashRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_TRANSACTION_BY_BLOCK_NUMBER_AND_INDEX: + serviceImpl.getTransactionByBlockNumberAndIndex((bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_TRANSACTION_BY_BLOCK_HASH_AND_INDEX: + serviceImpl.getTransactionByBlockHashAndIndex((bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class AccountingChainBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AccountingChainBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return bdchain.api.grpc.AccountingChainProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AccountingChain"); + } + } + + private static final class AccountingChainFileDescriptorSupplier + extends AccountingChainBaseDescriptorSupplier { + AccountingChainFileDescriptorSupplier() {} + } + + private static final class AccountingChainMethodDescriptorSupplier + extends AccountingChainBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AccountingChainMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (AccountingChainGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AccountingChainFileDescriptorSupplier()) + .addMethod(getBlockNumberMethod()) + .addMethod(getGetBlockByNumberMethod()) + .addMethod(getGetBlockByHashMethod()) + .addMethod(getGetTransactionByHashMethod()) + .addMethod(getGetTransactionByBlockNumberAndIndexMethod()) + .addMethod(getGetTransactionByBlockHashAndIndexMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/main/java/bdchain/api/grpc/AccountingChainProto.java b/src/main/java/bdchain/api/grpc/AccountingChainProto.java new file mode 100644 index 0000000..d20a014 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/AccountingChainProto.java @@ -0,0 +1,185 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +public final class AccountingChainProto { + private AccountingChainProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_Transaction_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_Transaction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_Block_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_Block_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_BlockNumberRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_BlockNumberRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_BlockNumberResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_BlockNumberResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_GetBlockByNumberRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_GetBlockByNumberRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_GetBlockByHashRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_GetBlockByHashRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_GetTransactionByHashRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_GetTransactionByHashRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_GetTransactionByBlockNumberAndIndexRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_GetTransactionByBlockNumberAndIndexRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_GetTransactionByBlockHashAndIndexRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_GetTransactionByBlockHashAndIndexRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\032bdchain/api/ac_chain.proto\022\013bdchain.ap" + + "i\032\030bdchain/api/common.proto\"\330\001\n\013Transact" + + "ion\022\024\n\014block_number\030\001 \001(\004\022\022\n\nblock_hash\030" + + "\002 \001(\014\022\r\n\005index\030\003 \001(\r\022\014\n\004hash\030\004 \001(\014\022*\n\004ty" + + "pe\030\005 \001(\0162\034.bdchain.api.TransactionType\022\014" + + "\n\004from\030\006 \001(\014\022\r\n\005nonce\030\007 \001(\004\022\n\n\002to\030\010 \001(\014\022" + + "\014\n\004data\030\t \001(\014\022\t\n\001v\030\n \001(\014\022\t\n\001r\030\013 \001(\014\022\t\n\001s" + + "\030\014 \001(\014\"\323\001\n\005Block\022\016\n\006number\030\001 \001(\004\022\014\n\004hash" + + "\030\002 \001(\014\022\023\n\013parent_hash\030\003 \001(\014\022\017\n\007witness\030\004" + + " \001(\014\022\021\n\ttimestamp\030\005 \001(\004\022\014\n\004size\030\006 \001(\004\022\031\n" + + "\021transactions_root\030\007 \001(\014\022.\n\014transactions" + + "\030\010 \003(\0132\030.bdchain.api.Transaction\022\032\n\022tran" + + "saction_hashes\030\t \003(\014\"$\n\022BlockNumberReque" + + "st\022\016\n\006ledger\030\001 \001(\t\"+\n\023BlockNumberRespons" + + "e\022\024\n\014block_number\030\001 \001(\004\"S\n\027GetBlockByNum" + + "berRequest\022\016\n\006ledger\030\001 \001(\t\022\016\n\006number\030\002 \001" + + "(\004\022\030\n\020full_transaction\030\003 \001(\010\"O\n\025GetBlock" + + "ByHashRequest\022\016\n\006ledger\030\001 \001(\t\022\014\n\004hash\030\002 " + + "\001(\014\022\030\n\020full_transaction\030\003 \001(\010\";\n\033GetTran" + + "sactionByHashRequest\022\016\n\006ledger\030\001 \001(\t\022\014\n\004" + + "hash\030\002 \001(\014\"a\n*GetTransactionByBlockNumbe" + + "rAndIndexRequest\022\016\n\006ledger\030\001 \001(\t\022\024\n\014bloc" + + "k_number\030\002 \001(\004\022\r\n\005index\030\003 \001(\r\"]\n(GetTran" + + "sactionByBlockHashAndIndexRequest\022\016\n\006led" + + "ger\030\001 \001(\t\022\022\n\nblock_hash\030\002 \001(\014\022\r\n\005index\030\003" + + " \001(\r2\301\004\n\017AccountingChain\022P\n\013BlockNumber\022" + + "\037.bdchain.api.BlockNumberRequest\032 .bdcha" + + "in.api.BlockNumberResponse\022L\n\020GetBlockBy" + + "Number\022$.bdchain.api.GetBlockByNumberReq" + + "uest\032\022.bdchain.api.Block\022H\n\016GetBlockByHa" + + "sh\022\".bdchain.api.GetBlockByHashRequest\032\022" + + ".bdchain.api.Block\022T\n\024GetTransactionByHa" + + "sh\022(.bdchain.api.GetTransactionByHashReq" + + "uest\032\022.bdchain.api.Block\022x\n#GetTransacti" + + "onByBlockNumberAndIndex\0227.bdchain.api.Ge" + + "tTransactionByBlockNumberAndIndexRequest" + + "\032\030.bdchain.api.Transaction\022t\n!GetTransac" + + "tionByBlockHashAndIndex\0225.bdchain.api.Ge" + + "tTransactionByBlockHashAndIndexRequest\032\030" + + ".bdchain.api.TransactionB@\n\020bdchain.api." + + "grpcB\024AccountingChainProtoP\001Z\024bdchain/ap" + + "i/ac_chainb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + bdchain.api.grpc.CommonProto.getDescriptor(), + }, assigner); + internal_static_bdchain_api_Transaction_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_bdchain_api_Transaction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_Transaction_descriptor, + new java.lang.String[] { "BlockNumber", "BlockHash", "Index", "Hash", "Type", "From", "Nonce", "To", "Data", "V", "R", "S", }); + internal_static_bdchain_api_Block_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_bdchain_api_Block_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_Block_descriptor, + new java.lang.String[] { "Number", "Hash", "ParentHash", "Witness", "Timestamp", "Size", "TransactionsRoot", "Transactions", "TransactionHashes", }); + internal_static_bdchain_api_BlockNumberRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_bdchain_api_BlockNumberRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_BlockNumberRequest_descriptor, + new java.lang.String[] { "Ledger", }); + internal_static_bdchain_api_BlockNumberResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_bdchain_api_BlockNumberResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_BlockNumberResponse_descriptor, + new java.lang.String[] { "BlockNumber", }); + internal_static_bdchain_api_GetBlockByNumberRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_bdchain_api_GetBlockByNumberRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_GetBlockByNumberRequest_descriptor, + new java.lang.String[] { "Ledger", "Number", "FullTransaction", }); + internal_static_bdchain_api_GetBlockByHashRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_bdchain_api_GetBlockByHashRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_GetBlockByHashRequest_descriptor, + new java.lang.String[] { "Ledger", "Hash", "FullTransaction", }); + internal_static_bdchain_api_GetTransactionByHashRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_bdchain_api_GetTransactionByHashRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_GetTransactionByHashRequest_descriptor, + new java.lang.String[] { "Ledger", "Hash", }); + internal_static_bdchain_api_GetTransactionByBlockNumberAndIndexRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_bdchain_api_GetTransactionByBlockNumberAndIndexRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_GetTransactionByBlockNumberAndIndexRequest_descriptor, + new java.lang.String[] { "Ledger", "BlockNumber", "Index", }); + internal_static_bdchain_api_GetTransactionByBlockHashAndIndexRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_bdchain_api_GetTransactionByBlockHashAndIndexRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_GetTransactionByBlockHashAndIndexRequest_descriptor, + new java.lang.String[] { "Ledger", "BlockHash", "Index", }); + bdchain.api.grpc.CommonProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/bdchain/api/grpc/Block.java b/src/main/java/bdchain/api/grpc/Block.java new file mode 100644 index 0000000..9cedfa6 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/Block.java @@ -0,0 +1,1568 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.Block} + */ +public final class Block extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.Block) + BlockOrBuilder { +private static final long serialVersionUID = 0L; + // Use Block.newBuilder() to construct. + private Block(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Block() { + number_ = 0L; + hash_ = com.google.protobuf.ByteString.EMPTY; + parentHash_ = com.google.protobuf.ByteString.EMPTY; + witness_ = com.google.protobuf.ByteString.EMPTY; + timestamp_ = 0L; + size_ = 0L; + transactionsRoot_ = com.google.protobuf.ByteString.EMPTY; + transactions_ = java.util.Collections.emptyList(); + transactionHashes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Block( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + number_ = input.readUInt64(); + break; + } + case 18: { + + hash_ = input.readBytes(); + break; + } + case 26: { + + parentHash_ = input.readBytes(); + break; + } + case 34: { + + witness_ = input.readBytes(); + break; + } + case 40: { + + timestamp_ = input.readUInt64(); + break; + } + case 48: { + + size_ = input.readUInt64(); + break; + } + case 58: { + + transactionsRoot_ = input.readBytes(); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + transactions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + transactions_.add( + input.readMessage(bdchain.api.grpc.Transaction.parser(), extensionRegistry)); + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + transactionHashes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + transactionHashes_.add(input.readBytes()); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + transactions_ = java.util.Collections.unmodifiableList(transactions_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + transactionHashes_ = java.util.Collections.unmodifiableList(transactionHashes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_Block_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_Block_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.Block.class, bdchain.api.grpc.Block.Builder.class); + } + + private int bitField0_; + public static final int NUMBER_FIELD_NUMBER = 1; + private long number_; + /** + *
+   * 区块号,当区块处于待确认状态时为`null`
+   * 
+ * + * uint64 number = 1; + */ + public long getNumber() { + return number_; + } + + public static final int HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString hash_; + /** + *
+   * 区块的哈希,当区块处于待确认状态时为`null`
+   * 
+ * + * bytes hash = 2; + */ + public com.google.protobuf.ByteString getHash() { + return hash_; + } + + public static final int PARENT_HASH_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString parentHash_; + /** + *
+   * 父区块的哈希
+   * 
+ * + * bytes parent_hash = 3; + */ + public com.google.protobuf.ByteString getParentHash() { + return parentHash_; + } + + public static final int WITNESS_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString witness_; + /** + *
+   * 见证者账户地址
+   * 
+ * + * bytes witness = 4; + */ + public com.google.protobuf.ByteString getWitness() { + return witness_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 5; + private long timestamp_; + /** + *
+   * 区块产生时的UNIX时间戳
+   * 
+ * + * uint64 timestamp = 5; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int SIZE_FIELD_NUMBER = 6; + private long size_; + /** + *
+   * 区块大小的字节数
+   * 
+ * + * uint64 size = 6; + */ + public long getSize() { + return size_; + } + + public static final int TRANSACTIONS_ROOT_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString transactionsRoot_; + /** + *
+   * 区块的事务树根
+   * 
+ * + * bytes transactions_root = 7; + */ + public com.google.protobuf.ByteString getTransactionsRoot() { + return transactionsRoot_; + } + + public static final int TRANSACTIONS_FIELD_NUMBER = 8; + private java.util.List transactions_; + /** + *
+   * 事务对象的数组,或为空
+   * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public java.util.List getTransactionsList() { + return transactions_; + } + /** + *
+   * 事务对象的数组,或为空
+   * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public java.util.List + getTransactionsOrBuilderList() { + return transactions_; + } + /** + *
+   * 事务对象的数组,或为空
+   * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public int getTransactionsCount() { + return transactions_.size(); + } + /** + *
+   * 事务对象的数组,或为空
+   * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public bdchain.api.grpc.Transaction getTransactions(int index) { + return transactions_.get(index); + } + /** + *
+   * 事务对象的数组,或为空
+   * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public bdchain.api.grpc.TransactionOrBuilder getTransactionsOrBuilder( + int index) { + return transactions_.get(index); + } + + public static final int TRANSACTION_HASHES_FIELD_NUMBER = 9; + private java.util.List transactionHashes_; + /** + *
+   * 32字节的交易哈希的数组,或为空
+   * 
+ * + * repeated bytes transaction_hashes = 9; + */ + public java.util.List + getTransactionHashesList() { + return transactionHashes_; + } + /** + *
+   * 32字节的交易哈希的数组,或为空
+   * 
+ * + * repeated bytes transaction_hashes = 9; + */ + public int getTransactionHashesCount() { + return transactionHashes_.size(); + } + /** + *
+   * 32字节的交易哈希的数组,或为空
+   * 
+ * + * repeated bytes transaction_hashes = 9; + */ + public com.google.protobuf.ByteString getTransactionHashes(int index) { + return transactionHashes_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (number_ != 0L) { + output.writeUInt64(1, number_); + } + if (!hash_.isEmpty()) { + output.writeBytes(2, hash_); + } + if (!parentHash_.isEmpty()) { + output.writeBytes(3, parentHash_); + } + if (!witness_.isEmpty()) { + output.writeBytes(4, witness_); + } + if (timestamp_ != 0L) { + output.writeUInt64(5, timestamp_); + } + if (size_ != 0L) { + output.writeUInt64(6, size_); + } + if (!transactionsRoot_.isEmpty()) { + output.writeBytes(7, transactionsRoot_); + } + for (int i = 0; i < transactions_.size(); i++) { + output.writeMessage(8, transactions_.get(i)); + } + for (int i = 0; i < transactionHashes_.size(); i++) { + output.writeBytes(9, transactionHashes_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (number_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, number_); + } + if (!hash_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, hash_); + } + if (!parentHash_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, parentHash_); + } + if (!witness_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, witness_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, timestamp_); + } + if (size_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(6, size_); + } + if (!transactionsRoot_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(7, transactionsRoot_); + } + for (int i = 0; i < transactions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, transactions_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < transactionHashes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(transactionHashes_.get(i)); + } + size += dataSize; + size += 1 * getTransactionHashesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.Block)) { + return super.equals(obj); + } + bdchain.api.grpc.Block other = (bdchain.api.grpc.Block) obj; + + boolean result = true; + result = result && (getNumber() + == other.getNumber()); + result = result && getHash() + .equals(other.getHash()); + result = result && getParentHash() + .equals(other.getParentHash()); + result = result && getWitness() + .equals(other.getWitness()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && (getSize() + == other.getSize()); + result = result && getTransactionsRoot() + .equals(other.getTransactionsRoot()); + result = result && getTransactionsList() + .equals(other.getTransactionsList()); + result = result && getTransactionHashesList() + .equals(other.getTransactionHashesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NUMBER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumber()); + hash = (37 * hash) + HASH_FIELD_NUMBER; + hash = (53 * hash) + getHash().hashCode(); + hash = (37 * hash) + PARENT_HASH_FIELD_NUMBER; + hash = (53 * hash) + getParentHash().hashCode(); + hash = (37 * hash) + WITNESS_FIELD_NUMBER; + hash = (53 * hash) + getWitness().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (37 * hash) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSize()); + hash = (37 * hash) + TRANSACTIONS_ROOT_FIELD_NUMBER; + hash = (53 * hash) + getTransactionsRoot().hashCode(); + if (getTransactionsCount() > 0) { + hash = (37 * hash) + TRANSACTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTransactionsList().hashCode(); + } + if (getTransactionHashesCount() > 0) { + hash = (37 * hash) + TRANSACTION_HASHES_FIELD_NUMBER; + hash = (53 * hash) + getTransactionHashesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.Block parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.Block parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.Block parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.Block parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.Block parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.Block parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.Block parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.Block parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.Block parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.Block parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.Block parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.Block parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.Block prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.Block} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.Block) + bdchain.api.grpc.BlockOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_Block_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_Block_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.Block.class, bdchain.api.grpc.Block.Builder.class); + } + + // Construct using bdchain.api.grpc.Block.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTransactionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + number_ = 0L; + + hash_ = com.google.protobuf.ByteString.EMPTY; + + parentHash_ = com.google.protobuf.ByteString.EMPTY; + + witness_ = com.google.protobuf.ByteString.EMPTY; + + timestamp_ = 0L; + + size_ = 0L; + + transactionsRoot_ = com.google.protobuf.ByteString.EMPTY; + + if (transactionsBuilder_ == null) { + transactions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + } else { + transactionsBuilder_.clear(); + } + transactionHashes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_Block_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.Block getDefaultInstanceForType() { + return bdchain.api.grpc.Block.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.Block build() { + bdchain.api.grpc.Block result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.Block buildPartial() { + bdchain.api.grpc.Block result = new bdchain.api.grpc.Block(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.number_ = number_; + result.hash_ = hash_; + result.parentHash_ = parentHash_; + result.witness_ = witness_; + result.timestamp_ = timestamp_; + result.size_ = size_; + result.transactionsRoot_ = transactionsRoot_; + if (transactionsBuilder_ == null) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { + transactions_ = java.util.Collections.unmodifiableList(transactions_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.transactions_ = transactions_; + } else { + result.transactions_ = transactionsBuilder_.build(); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + transactionHashes_ = java.util.Collections.unmodifiableList(transactionHashes_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.transactionHashes_ = transactionHashes_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.Block) { + return mergeFrom((bdchain.api.grpc.Block)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.Block other) { + if (other == bdchain.api.grpc.Block.getDefaultInstance()) return this; + if (other.getNumber() != 0L) { + setNumber(other.getNumber()); + } + if (other.getHash() != com.google.protobuf.ByteString.EMPTY) { + setHash(other.getHash()); + } + if (other.getParentHash() != com.google.protobuf.ByteString.EMPTY) { + setParentHash(other.getParentHash()); + } + if (other.getWitness() != com.google.protobuf.ByteString.EMPTY) { + setWitness(other.getWitness()); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + if (other.getSize() != 0L) { + setSize(other.getSize()); + } + if (other.getTransactionsRoot() != com.google.protobuf.ByteString.EMPTY) { + setTransactionsRoot(other.getTransactionsRoot()); + } + if (transactionsBuilder_ == null) { + if (!other.transactions_.isEmpty()) { + if (transactions_.isEmpty()) { + transactions_ = other.transactions_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureTransactionsIsMutable(); + transactions_.addAll(other.transactions_); + } + onChanged(); + } + } else { + if (!other.transactions_.isEmpty()) { + if (transactionsBuilder_.isEmpty()) { + transactionsBuilder_.dispose(); + transactionsBuilder_ = null; + transactions_ = other.transactions_; + bitField0_ = (bitField0_ & ~0x00000080); + transactionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTransactionsFieldBuilder() : null; + } else { + transactionsBuilder_.addAllMessages(other.transactions_); + } + } + } + if (!other.transactionHashes_.isEmpty()) { + if (transactionHashes_.isEmpty()) { + transactionHashes_ = other.transactionHashes_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureTransactionHashesIsMutable(); + transactionHashes_.addAll(other.transactionHashes_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.Block parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.Block) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long number_ ; + /** + *
+     * 区块号,当区块处于待确认状态时为`null`
+     * 
+ * + * uint64 number = 1; + */ + public long getNumber() { + return number_; + } + /** + *
+     * 区块号,当区块处于待确认状态时为`null`
+     * 
+ * + * uint64 number = 1; + */ + public Builder setNumber(long value) { + + number_ = value; + onChanged(); + return this; + } + /** + *
+     * 区块号,当区块处于待确认状态时为`null`
+     * 
+ * + * uint64 number = 1; + */ + public Builder clearNumber() { + + number_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * 区块的哈希,当区块处于待确认状态时为`null`
+     * 
+ * + * bytes hash = 2; + */ + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + *
+     * 区块的哈希,当区块处于待确认状态时为`null`
+     * 
+ * + * bytes hash = 2; + */ + public Builder setHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + hash_ = value; + onChanged(); + return this; + } + /** + *
+     * 区块的哈希,当区块处于待确认状态时为`null`
+     * 
+ * + * bytes hash = 2; + */ + public Builder clearHash() { + + hash_ = getDefaultInstance().getHash(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString parentHash_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * 父区块的哈希
+     * 
+ * + * bytes parent_hash = 3; + */ + public com.google.protobuf.ByteString getParentHash() { + return parentHash_; + } + /** + *
+     * 父区块的哈希
+     * 
+ * + * bytes parent_hash = 3; + */ + public Builder setParentHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + parentHash_ = value; + onChanged(); + return this; + } + /** + *
+     * 父区块的哈希
+     * 
+ * + * bytes parent_hash = 3; + */ + public Builder clearParentHash() { + + parentHash_ = getDefaultInstance().getParentHash(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString witness_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * 见证者账户地址
+     * 
+ * + * bytes witness = 4; + */ + public com.google.protobuf.ByteString getWitness() { + return witness_; + } + /** + *
+     * 见证者账户地址
+     * 
+ * + * bytes witness = 4; + */ + public Builder setWitness(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + witness_ = value; + onChanged(); + return this; + } + /** + *
+     * 见证者账户地址
+     * 
+ * + * bytes witness = 4; + */ + public Builder clearWitness() { + + witness_ = getDefaultInstance().getWitness(); + onChanged(); + return this; + } + + private long timestamp_ ; + /** + *
+     * 区块产生时的UNIX时间戳
+     * 
+ * + * uint64 timestamp = 5; + */ + public long getTimestamp() { + return timestamp_; + } + /** + *
+     * 区块产生时的UNIX时间戳
+     * 
+ * + * uint64 timestamp = 5; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + *
+     * 区块产生时的UNIX时间戳
+     * 
+ * + * uint64 timestamp = 5; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private long size_ ; + /** + *
+     * 区块大小的字节数
+     * 
+ * + * uint64 size = 6; + */ + public long getSize() { + return size_; + } + /** + *
+     * 区块大小的字节数
+     * 
+ * + * uint64 size = 6; + */ + public Builder setSize(long value) { + + size_ = value; + onChanged(); + return this; + } + /** + *
+     * 区块大小的字节数
+     * 
+ * + * uint64 size = 6; + */ + public Builder clearSize() { + + size_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString transactionsRoot_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * 区块的事务树根
+     * 
+ * + * bytes transactions_root = 7; + */ + public com.google.protobuf.ByteString getTransactionsRoot() { + return transactionsRoot_; + } + /** + *
+     * 区块的事务树根
+     * 
+ * + * bytes transactions_root = 7; + */ + public Builder setTransactionsRoot(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + transactionsRoot_ = value; + onChanged(); + return this; + } + /** + *
+     * 区块的事务树根
+     * 
+ * + * bytes transactions_root = 7; + */ + public Builder clearTransactionsRoot() { + + transactionsRoot_ = getDefaultInstance().getTransactionsRoot(); + onChanged(); + return this; + } + + private java.util.List transactions_ = + java.util.Collections.emptyList(); + private void ensureTransactionsIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + transactions_ = new java.util.ArrayList(transactions_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + bdchain.api.grpc.Transaction, bdchain.api.grpc.Transaction.Builder, bdchain.api.grpc.TransactionOrBuilder> transactionsBuilder_; + + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public java.util.List getTransactionsList() { + if (transactionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(transactions_); + } else { + return transactionsBuilder_.getMessageList(); + } + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public int getTransactionsCount() { + if (transactionsBuilder_ == null) { + return transactions_.size(); + } else { + return transactionsBuilder_.getCount(); + } + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public bdchain.api.grpc.Transaction getTransactions(int index) { + if (transactionsBuilder_ == null) { + return transactions_.get(index); + } else { + return transactionsBuilder_.getMessage(index); + } + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public Builder setTransactions( + int index, bdchain.api.grpc.Transaction value) { + if (transactionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionsIsMutable(); + transactions_.set(index, value); + onChanged(); + } else { + transactionsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public Builder setTransactions( + int index, bdchain.api.grpc.Transaction.Builder builderForValue) { + if (transactionsBuilder_ == null) { + ensureTransactionsIsMutable(); + transactions_.set(index, builderForValue.build()); + onChanged(); + } else { + transactionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public Builder addTransactions(bdchain.api.grpc.Transaction value) { + if (transactionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionsIsMutable(); + transactions_.add(value); + onChanged(); + } else { + transactionsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public Builder addTransactions( + int index, bdchain.api.grpc.Transaction value) { + if (transactionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionsIsMutable(); + transactions_.add(index, value); + onChanged(); + } else { + transactionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public Builder addTransactions( + bdchain.api.grpc.Transaction.Builder builderForValue) { + if (transactionsBuilder_ == null) { + ensureTransactionsIsMutable(); + transactions_.add(builderForValue.build()); + onChanged(); + } else { + transactionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public Builder addTransactions( + int index, bdchain.api.grpc.Transaction.Builder builderForValue) { + if (transactionsBuilder_ == null) { + ensureTransactionsIsMutable(); + transactions_.add(index, builderForValue.build()); + onChanged(); + } else { + transactionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public Builder addAllTransactions( + java.lang.Iterable values) { + if (transactionsBuilder_ == null) { + ensureTransactionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, transactions_); + onChanged(); + } else { + transactionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public Builder clearTransactions() { + if (transactionsBuilder_ == null) { + transactions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + transactionsBuilder_.clear(); + } + return this; + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public Builder removeTransactions(int index) { + if (transactionsBuilder_ == null) { + ensureTransactionsIsMutable(); + transactions_.remove(index); + onChanged(); + } else { + transactionsBuilder_.remove(index); + } + return this; + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public bdchain.api.grpc.Transaction.Builder getTransactionsBuilder( + int index) { + return getTransactionsFieldBuilder().getBuilder(index); + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public bdchain.api.grpc.TransactionOrBuilder getTransactionsOrBuilder( + int index) { + if (transactionsBuilder_ == null) { + return transactions_.get(index); } else { + return transactionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public java.util.List + getTransactionsOrBuilderList() { + if (transactionsBuilder_ != null) { + return transactionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(transactions_); + } + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public bdchain.api.grpc.Transaction.Builder addTransactionsBuilder() { + return getTransactionsFieldBuilder().addBuilder( + bdchain.api.grpc.Transaction.getDefaultInstance()); + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public bdchain.api.grpc.Transaction.Builder addTransactionsBuilder( + int index) { + return getTransactionsFieldBuilder().addBuilder( + index, bdchain.api.grpc.Transaction.getDefaultInstance()); + } + /** + *
+     * 事务对象的数组,或为空
+     * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + public java.util.List + getTransactionsBuilderList() { + return getTransactionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + bdchain.api.grpc.Transaction, bdchain.api.grpc.Transaction.Builder, bdchain.api.grpc.TransactionOrBuilder> + getTransactionsFieldBuilder() { + if (transactionsBuilder_ == null) { + transactionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + bdchain.api.grpc.Transaction, bdchain.api.grpc.Transaction.Builder, bdchain.api.grpc.TransactionOrBuilder>( + transactions_, + ((bitField0_ & 0x00000080) == 0x00000080), + getParentForChildren(), + isClean()); + transactions_ = null; + } + return transactionsBuilder_; + } + + private java.util.List transactionHashes_ = java.util.Collections.emptyList(); + private void ensureTransactionHashesIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + transactionHashes_ = new java.util.ArrayList(transactionHashes_); + bitField0_ |= 0x00000100; + } + } + /** + *
+     * 32字节的交易哈希的数组,或为空
+     * 
+ * + * repeated bytes transaction_hashes = 9; + */ + public java.util.List + getTransactionHashesList() { + return java.util.Collections.unmodifiableList(transactionHashes_); + } + /** + *
+     * 32字节的交易哈希的数组,或为空
+     * 
+ * + * repeated bytes transaction_hashes = 9; + */ + public int getTransactionHashesCount() { + return transactionHashes_.size(); + } + /** + *
+     * 32字节的交易哈希的数组,或为空
+     * 
+ * + * repeated bytes transaction_hashes = 9; + */ + public com.google.protobuf.ByteString getTransactionHashes(int index) { + return transactionHashes_.get(index); + } + /** + *
+     * 32字节的交易哈希的数组,或为空
+     * 
+ * + * repeated bytes transaction_hashes = 9; + */ + public Builder setTransactionHashes( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionHashesIsMutable(); + transactionHashes_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * 32字节的交易哈希的数组,或为空
+     * 
+ * + * repeated bytes transaction_hashes = 9; + */ + public Builder addTransactionHashes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionHashesIsMutable(); + transactionHashes_.add(value); + onChanged(); + return this; + } + /** + *
+     * 32字节的交易哈希的数组,或为空
+     * 
+ * + * repeated bytes transaction_hashes = 9; + */ + public Builder addAllTransactionHashes( + java.lang.Iterable values) { + ensureTransactionHashesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, transactionHashes_); + onChanged(); + return this; + } + /** + *
+     * 32字节的交易哈希的数组,或为空
+     * 
+ * + * repeated bytes transaction_hashes = 9; + */ + public Builder clearTransactionHashes() { + transactionHashes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.Block) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.Block) + private static final bdchain.api.grpc.Block DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.Block(); + } + + public static bdchain.api.grpc.Block getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Block parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Block(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.Block getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/BlockNumberRequest.java b/src/main/java/bdchain/api/grpc/BlockNumberRequest.java new file mode 100644 index 0000000..432007f --- /dev/null +++ b/src/main/java/bdchain/api/grpc/BlockNumberRequest.java @@ -0,0 +1,541 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.BlockNumberRequest} + */ +public final class BlockNumberRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.BlockNumberRequest) + BlockNumberRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use BlockNumberRequest.newBuilder() to construct. + private BlockNumberRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BlockNumberRequest() { + ledger_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BlockNumberRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + ledger_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_BlockNumberRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_BlockNumberRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.BlockNumberRequest.class, bdchain.api.grpc.BlockNumberRequest.Builder.class); + } + + public static final int LEDGER_FIELD_NUMBER = 1; + private volatile java.lang.Object ledger_; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLedgerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ledger_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLedgerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ledger_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.BlockNumberRequest)) { + return super.equals(obj); + } + bdchain.api.grpc.BlockNumberRequest other = (bdchain.api.grpc.BlockNumberRequest) obj; + + boolean result = true; + result = result && getLedger() + .equals(other.getLedger()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LEDGER_FIELD_NUMBER; + hash = (53 * hash) + getLedger().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.BlockNumberRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.BlockNumberRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.BlockNumberRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.BlockNumberRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.BlockNumberRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.BlockNumberRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.BlockNumberRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.BlockNumberRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.BlockNumberRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.BlockNumberRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.BlockNumberRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.BlockNumberRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.BlockNumberRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.BlockNumberRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.BlockNumberRequest) + bdchain.api.grpc.BlockNumberRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_BlockNumberRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_BlockNumberRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.BlockNumberRequest.class, bdchain.api.grpc.BlockNumberRequest.Builder.class); + } + + // Construct using bdchain.api.grpc.BlockNumberRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ledger_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_BlockNumberRequest_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.BlockNumberRequest getDefaultInstanceForType() { + return bdchain.api.grpc.BlockNumberRequest.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.BlockNumberRequest build() { + bdchain.api.grpc.BlockNumberRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.BlockNumberRequest buildPartial() { + bdchain.api.grpc.BlockNumberRequest result = new bdchain.api.grpc.BlockNumberRequest(this); + result.ledger_ = ledger_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.BlockNumberRequest) { + return mergeFrom((bdchain.api.grpc.BlockNumberRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.BlockNumberRequest other) { + if (other == bdchain.api.grpc.BlockNumberRequest.getDefaultInstance()) return this; + if (!other.getLedger().isEmpty()) { + ledger_ = other.ledger_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.BlockNumberRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.BlockNumberRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ledger_ = ""; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string ledger = 1; + */ + public Builder setLedger( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ledger_ = value; + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder clearLedger() { + + ledger_ = getDefaultInstance().getLedger(); + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder setLedgerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ledger_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.BlockNumberRequest) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.BlockNumberRequest) + private static final bdchain.api.grpc.BlockNumberRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.BlockNumberRequest(); + } + + public static bdchain.api.grpc.BlockNumberRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlockNumberRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BlockNumberRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.BlockNumberRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/BlockNumberRequestOrBuilder.java b/src/main/java/bdchain/api/grpc/BlockNumberRequestOrBuilder.java new file mode 100644 index 0000000..cc4bb01 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/BlockNumberRequestOrBuilder.java @@ -0,0 +1,19 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +public interface BlockNumberRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.BlockNumberRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string ledger = 1; + */ + java.lang.String getLedger(); + /** + * string ledger = 1; + */ + com.google.protobuf.ByteString + getLedgerBytes(); +} diff --git a/src/main/java/bdchain/api/grpc/BlockNumberResponse.java b/src/main/java/bdchain/api/grpc/BlockNumberResponse.java new file mode 100644 index 0000000..ce580c9 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/BlockNumberResponse.java @@ -0,0 +1,473 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.BlockNumberResponse} + */ +public final class BlockNumberResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.BlockNumberResponse) + BlockNumberResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use BlockNumberResponse.newBuilder() to construct. + private BlockNumberResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BlockNumberResponse() { + blockNumber_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BlockNumberResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + blockNumber_ = input.readUInt64(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_BlockNumberResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_BlockNumberResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.BlockNumberResponse.class, bdchain.api.grpc.BlockNumberResponse.Builder.class); + } + + public static final int BLOCK_NUMBER_FIELD_NUMBER = 1; + private long blockNumber_; + /** + * uint64 block_number = 1; + */ + public long getBlockNumber() { + return blockNumber_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (blockNumber_ != 0L) { + output.writeUInt64(1, blockNumber_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (blockNumber_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, blockNumber_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.BlockNumberResponse)) { + return super.equals(obj); + } + bdchain.api.grpc.BlockNumberResponse other = (bdchain.api.grpc.BlockNumberResponse) obj; + + boolean result = true; + result = result && (getBlockNumber() + == other.getBlockNumber()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BLOCK_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBlockNumber()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.BlockNumberResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.BlockNumberResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.BlockNumberResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.BlockNumberResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.BlockNumberResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.BlockNumberResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.BlockNumberResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.BlockNumberResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.BlockNumberResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.BlockNumberResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.BlockNumberResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.BlockNumberResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.BlockNumberResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.BlockNumberResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.BlockNumberResponse) + bdchain.api.grpc.BlockNumberResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_BlockNumberResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_BlockNumberResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.BlockNumberResponse.class, bdchain.api.grpc.BlockNumberResponse.Builder.class); + } + + // Construct using bdchain.api.grpc.BlockNumberResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + blockNumber_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_BlockNumberResponse_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.BlockNumberResponse getDefaultInstanceForType() { + return bdchain.api.grpc.BlockNumberResponse.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.BlockNumberResponse build() { + bdchain.api.grpc.BlockNumberResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.BlockNumberResponse buildPartial() { + bdchain.api.grpc.BlockNumberResponse result = new bdchain.api.grpc.BlockNumberResponse(this); + result.blockNumber_ = blockNumber_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.BlockNumberResponse) { + return mergeFrom((bdchain.api.grpc.BlockNumberResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.BlockNumberResponse other) { + if (other == bdchain.api.grpc.BlockNumberResponse.getDefaultInstance()) return this; + if (other.getBlockNumber() != 0L) { + setBlockNumber(other.getBlockNumber()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.BlockNumberResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.BlockNumberResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long blockNumber_ ; + /** + * uint64 block_number = 1; + */ + public long getBlockNumber() { + return blockNumber_; + } + /** + * uint64 block_number = 1; + */ + public Builder setBlockNumber(long value) { + + blockNumber_ = value; + onChanged(); + return this; + } + /** + * uint64 block_number = 1; + */ + public Builder clearBlockNumber() { + + blockNumber_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.BlockNumberResponse) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.BlockNumberResponse) + private static final bdchain.api.grpc.BlockNumberResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.BlockNumberResponse(); + } + + public static bdchain.api.grpc.BlockNumberResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlockNumberResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BlockNumberResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.BlockNumberResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/BlockNumberResponseOrBuilder.java b/src/main/java/bdchain/api/grpc/BlockNumberResponseOrBuilder.java new file mode 100644 index 0000000..63894e9 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/BlockNumberResponseOrBuilder.java @@ -0,0 +1,14 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +public interface BlockNumberResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.BlockNumberResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 block_number = 1; + */ + long getBlockNumber(); +} diff --git a/src/main/java/bdchain/api/grpc/BlockOrBuilder.java b/src/main/java/bdchain/api/grpc/BlockOrBuilder.java new file mode 100644 index 0000000..8b5b9d0 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/BlockOrBuilder.java @@ -0,0 +1,141 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +public interface BlockOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.Block) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * 区块号,当区块处于待确认状态时为`null`
+   * 
+ * + * uint64 number = 1; + */ + long getNumber(); + + /** + *
+   * 区块的哈希,当区块处于待确认状态时为`null`
+   * 
+ * + * bytes hash = 2; + */ + com.google.protobuf.ByteString getHash(); + + /** + *
+   * 父区块的哈希
+   * 
+ * + * bytes parent_hash = 3; + */ + com.google.protobuf.ByteString getParentHash(); + + /** + *
+   * 见证者账户地址
+   * 
+ * + * bytes witness = 4; + */ + com.google.protobuf.ByteString getWitness(); + + /** + *
+   * 区块产生时的UNIX时间戳
+   * 
+ * + * uint64 timestamp = 5; + */ + long getTimestamp(); + + /** + *
+   * 区块大小的字节数
+   * 
+ * + * uint64 size = 6; + */ + long getSize(); + + /** + *
+   * 区块的事务树根
+   * 
+ * + * bytes transactions_root = 7; + */ + com.google.protobuf.ByteString getTransactionsRoot(); + + /** + *
+   * 事务对象的数组,或为空
+   * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + java.util.List + getTransactionsList(); + /** + *
+   * 事务对象的数组,或为空
+   * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + bdchain.api.grpc.Transaction getTransactions(int index); + /** + *
+   * 事务对象的数组,或为空
+   * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + int getTransactionsCount(); + /** + *
+   * 事务对象的数组,或为空
+   * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + java.util.List + getTransactionsOrBuilderList(); + /** + *
+   * 事务对象的数组,或为空
+   * 
+ * + * repeated .bdchain.api.Transaction transactions = 8; + */ + bdchain.api.grpc.TransactionOrBuilder getTransactionsOrBuilder( + int index); + + /** + *
+   * 32字节的交易哈希的数组,或为空
+   * 
+ * + * repeated bytes transaction_hashes = 9; + */ + java.util.List getTransactionHashesList(); + /** + *
+   * 32字节的交易哈希的数组,或为空
+   * 
+ * + * repeated bytes transaction_hashes = 9; + */ + int getTransactionHashesCount(); + /** + *
+   * 32字节的交易哈希的数组,或为空
+   * 
+ * + * repeated bytes transaction_hashes = 9; + */ + com.google.protobuf.ByteString getTransactionHashes(int index); +} diff --git a/src/main/java/bdchain/api/grpc/CommonProto.java b/src/main/java/bdchain/api/grpc/CommonProto.java new file mode 100644 index 0000000..23826ac --- /dev/null +++ b/src/main/java/bdchain/api/grpc/CommonProto.java @@ -0,0 +1,47 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/common.proto + +package bdchain.api.grpc; + +public final class CommonProto { + private CommonProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\030bdchain/api/common.proto\022\013bdchain.api*" + + "Z\n\017TransactionType\022\n\n\006RECORD\020\000\022\013\n\007MESSAG" + + "E\020\001\022\025\n\021CONTRACT_CREATION\020\002\022\027\n\023CONTRACT_I" + + "NVOCATION\020\003B5\n\020bdchain.api.grpcB\013CommonP" + + "rotoP\001Z\022bdchain/api/commonb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/bdchain/api/grpc/CreateLedgerRequest.java b/src/main/java/bdchain/api/grpc/CreateLedgerRequest.java new file mode 100644 index 0000000..be80baf --- /dev/null +++ b/src/main/java/bdchain/api/grpc/CreateLedgerRequest.java @@ -0,0 +1,541 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.CreateLedgerRequest} + */ +public final class CreateLedgerRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.CreateLedgerRequest) + CreateLedgerRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateLedgerRequest.newBuilder() to construct. + private CreateLedgerRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateLedgerRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateLedgerRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_CreateLedgerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_CreateLedgerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.CreateLedgerRequest.class, bdchain.api.grpc.CreateLedgerRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.CreateLedgerRequest)) { + return super.equals(obj); + } + bdchain.api.grpc.CreateLedgerRequest other = (bdchain.api.grpc.CreateLedgerRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.CreateLedgerRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.CreateLedgerRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.CreateLedgerRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.CreateLedgerRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.CreateLedgerRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.CreateLedgerRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.CreateLedgerRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.CreateLedgerRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.CreateLedgerRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.CreateLedgerRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.CreateLedgerRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.CreateLedgerRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.CreateLedgerRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.CreateLedgerRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.CreateLedgerRequest) + bdchain.api.grpc.CreateLedgerRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_CreateLedgerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_CreateLedgerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.CreateLedgerRequest.class, bdchain.api.grpc.CreateLedgerRequest.Builder.class); + } + + // Construct using bdchain.api.grpc.CreateLedgerRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_CreateLedgerRequest_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.CreateLedgerRequest getDefaultInstanceForType() { + return bdchain.api.grpc.CreateLedgerRequest.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.CreateLedgerRequest build() { + bdchain.api.grpc.CreateLedgerRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.CreateLedgerRequest buildPartial() { + bdchain.api.grpc.CreateLedgerRequest result = new bdchain.api.grpc.CreateLedgerRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.CreateLedgerRequest) { + return mergeFrom((bdchain.api.grpc.CreateLedgerRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.CreateLedgerRequest other) { + if (other == bdchain.api.grpc.CreateLedgerRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.CreateLedgerRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.CreateLedgerRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.CreateLedgerRequest) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.CreateLedgerRequest) + private static final bdchain.api.grpc.CreateLedgerRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.CreateLedgerRequest(); + } + + public static bdchain.api.grpc.CreateLedgerRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateLedgerRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateLedgerRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.CreateLedgerRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/CreateLedgerRequestOrBuilder.java b/src/main/java/bdchain/api/grpc/CreateLedgerRequestOrBuilder.java new file mode 100644 index 0000000..9e704dc --- /dev/null +++ b/src/main/java/bdchain/api/grpc/CreateLedgerRequestOrBuilder.java @@ -0,0 +1,19 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +public interface CreateLedgerRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.CreateLedgerRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + */ + java.lang.String getName(); + /** + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/src/main/java/bdchain/api/grpc/CreateLedgerResponse.java b/src/main/java/bdchain/api/grpc/CreateLedgerResponse.java new file mode 100644 index 0000000..1bc76a9 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/CreateLedgerResponse.java @@ -0,0 +1,473 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.CreateLedgerResponse} + */ +public final class CreateLedgerResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.CreateLedgerResponse) + CreateLedgerResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateLedgerResponse.newBuilder() to construct. + private CreateLedgerResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateLedgerResponse() { + ok_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateLedgerResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + ok_ = input.readBool(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_CreateLedgerResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_CreateLedgerResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.CreateLedgerResponse.class, bdchain.api.grpc.CreateLedgerResponse.Builder.class); + } + + public static final int OK_FIELD_NUMBER = 1; + private boolean ok_; + /** + * bool ok = 1; + */ + public boolean getOk() { + return ok_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (ok_ != false) { + output.writeBool(1, ok_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ok_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, ok_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.CreateLedgerResponse)) { + return super.equals(obj); + } + bdchain.api.grpc.CreateLedgerResponse other = (bdchain.api.grpc.CreateLedgerResponse) obj; + + boolean result = true; + result = result && (getOk() + == other.getOk()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getOk()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.CreateLedgerResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.CreateLedgerResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.CreateLedgerResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.CreateLedgerResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.CreateLedgerResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.CreateLedgerResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.CreateLedgerResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.CreateLedgerResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.CreateLedgerResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.CreateLedgerResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.CreateLedgerResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.CreateLedgerResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.CreateLedgerResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.CreateLedgerResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.CreateLedgerResponse) + bdchain.api.grpc.CreateLedgerResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_CreateLedgerResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_CreateLedgerResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.CreateLedgerResponse.class, bdchain.api.grpc.CreateLedgerResponse.Builder.class); + } + + // Construct using bdchain.api.grpc.CreateLedgerResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ok_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_CreateLedgerResponse_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.CreateLedgerResponse getDefaultInstanceForType() { + return bdchain.api.grpc.CreateLedgerResponse.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.CreateLedgerResponse build() { + bdchain.api.grpc.CreateLedgerResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.CreateLedgerResponse buildPartial() { + bdchain.api.grpc.CreateLedgerResponse result = new bdchain.api.grpc.CreateLedgerResponse(this); + result.ok_ = ok_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.CreateLedgerResponse) { + return mergeFrom((bdchain.api.grpc.CreateLedgerResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.CreateLedgerResponse other) { + if (other == bdchain.api.grpc.CreateLedgerResponse.getDefaultInstance()) return this; + if (other.getOk() != false) { + setOk(other.getOk()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.CreateLedgerResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.CreateLedgerResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean ok_ ; + /** + * bool ok = 1; + */ + public boolean getOk() { + return ok_; + } + /** + * bool ok = 1; + */ + public Builder setOk(boolean value) { + + ok_ = value; + onChanged(); + return this; + } + /** + * bool ok = 1; + */ + public Builder clearOk() { + + ok_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.CreateLedgerResponse) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.CreateLedgerResponse) + private static final bdchain.api.grpc.CreateLedgerResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.CreateLedgerResponse(); + } + + public static bdchain.api.grpc.CreateLedgerResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateLedgerResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateLedgerResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.CreateLedgerResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/CreateLedgerResponseOrBuilder.java b/src/main/java/bdchain/api/grpc/CreateLedgerResponseOrBuilder.java new file mode 100644 index 0000000..f9454e1 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/CreateLedgerResponseOrBuilder.java @@ -0,0 +1,14 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +public interface CreateLedgerResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.CreateLedgerResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * bool ok = 1; + */ + boolean getOk(); +} diff --git a/src/main/java/bdchain/api/grpc/GetBlockByHashRequest.java b/src/main/java/bdchain/api/grpc/GetBlockByHashRequest.java new file mode 100644 index 0000000..0e96963 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetBlockByHashRequest.java @@ -0,0 +1,661 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.GetBlockByHashRequest} + */ +public final class GetBlockByHashRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.GetBlockByHashRequest) + GetBlockByHashRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetBlockByHashRequest.newBuilder() to construct. + private GetBlockByHashRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetBlockByHashRequest() { + ledger_ = ""; + hash_ = com.google.protobuf.ByteString.EMPTY; + fullTransaction_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetBlockByHashRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + ledger_ = s; + break; + } + case 18: { + + hash_ = input.readBytes(); + break; + } + case 24: { + + fullTransaction_ = input.readBool(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetBlockByHashRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetBlockByHashRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetBlockByHashRequest.class, bdchain.api.grpc.GetBlockByHashRequest.Builder.class); + } + + public static final int LEDGER_FIELD_NUMBER = 1; + private volatile java.lang.Object ledger_; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 2; + */ + public com.google.protobuf.ByteString getHash() { + return hash_; + } + + public static final int FULL_TRANSACTION_FIELD_NUMBER = 3; + private boolean fullTransaction_; + /** + * bool full_transaction = 3; + */ + public boolean getFullTransaction() { + return fullTransaction_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLedgerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ledger_); + } + if (!hash_.isEmpty()) { + output.writeBytes(2, hash_); + } + if (fullTransaction_ != false) { + output.writeBool(3, fullTransaction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLedgerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ledger_); + } + if (!hash_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, hash_); + } + if (fullTransaction_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, fullTransaction_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.GetBlockByHashRequest)) { + return super.equals(obj); + } + bdchain.api.grpc.GetBlockByHashRequest other = (bdchain.api.grpc.GetBlockByHashRequest) obj; + + boolean result = true; + result = result && getLedger() + .equals(other.getLedger()); + result = result && getHash() + .equals(other.getHash()); + result = result && (getFullTransaction() + == other.getFullTransaction()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LEDGER_FIELD_NUMBER; + hash = (53 * hash) + getLedger().hashCode(); + hash = (37 * hash) + HASH_FIELD_NUMBER; + hash = (53 * hash) + getHash().hashCode(); + hash = (37 * hash) + FULL_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFullTransaction()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.GetBlockByHashRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetBlockByHashRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.GetBlockByHashRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.GetBlockByHashRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.GetBlockByHashRequest) + bdchain.api.grpc.GetBlockByHashRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetBlockByHashRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetBlockByHashRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetBlockByHashRequest.class, bdchain.api.grpc.GetBlockByHashRequest.Builder.class); + } + + // Construct using bdchain.api.grpc.GetBlockByHashRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ledger_ = ""; + + hash_ = com.google.protobuf.ByteString.EMPTY; + + fullTransaction_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetBlockByHashRequest_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.GetBlockByHashRequest getDefaultInstanceForType() { + return bdchain.api.grpc.GetBlockByHashRequest.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.GetBlockByHashRequest build() { + bdchain.api.grpc.GetBlockByHashRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.GetBlockByHashRequest buildPartial() { + bdchain.api.grpc.GetBlockByHashRequest result = new bdchain.api.grpc.GetBlockByHashRequest(this); + result.ledger_ = ledger_; + result.hash_ = hash_; + result.fullTransaction_ = fullTransaction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.GetBlockByHashRequest) { + return mergeFrom((bdchain.api.grpc.GetBlockByHashRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.GetBlockByHashRequest other) { + if (other == bdchain.api.grpc.GetBlockByHashRequest.getDefaultInstance()) return this; + if (!other.getLedger().isEmpty()) { + ledger_ = other.ledger_; + onChanged(); + } + if (other.getHash() != com.google.protobuf.ByteString.EMPTY) { + setHash(other.getHash()); + } + if (other.getFullTransaction() != false) { + setFullTransaction(other.getFullTransaction()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.GetBlockByHashRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.GetBlockByHashRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ledger_ = ""; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string ledger = 1; + */ + public Builder setLedger( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ledger_ = value; + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder clearLedger() { + + ledger_ = getDefaultInstance().getLedger(); + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder setLedgerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ledger_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes hash = 2; + */ + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 2; + */ + public Builder setHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + hash_ = value; + onChanged(); + return this; + } + /** + * bytes hash = 2; + */ + public Builder clearHash() { + + hash_ = getDefaultInstance().getHash(); + onChanged(); + return this; + } + + private boolean fullTransaction_ ; + /** + * bool full_transaction = 3; + */ + public boolean getFullTransaction() { + return fullTransaction_; + } + /** + * bool full_transaction = 3; + */ + public Builder setFullTransaction(boolean value) { + + fullTransaction_ = value; + onChanged(); + return this; + } + /** + * bool full_transaction = 3; + */ + public Builder clearFullTransaction() { + + fullTransaction_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.GetBlockByHashRequest) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.GetBlockByHashRequest) + private static final bdchain.api.grpc.GetBlockByHashRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.GetBlockByHashRequest(); + } + + public static bdchain.api.grpc.GetBlockByHashRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBlockByHashRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBlockByHashRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.GetBlockByHashRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/GetBlockByHashRequestOrBuilder.java b/src/main/java/bdchain/api/grpc/GetBlockByHashRequestOrBuilder.java new file mode 100644 index 0000000..9efb63a --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetBlockByHashRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +public interface GetBlockByHashRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.GetBlockByHashRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string ledger = 1; + */ + java.lang.String getLedger(); + /** + * string ledger = 1; + */ + com.google.protobuf.ByteString + getLedgerBytes(); + + /** + * bytes hash = 2; + */ + com.google.protobuf.ByteString getHash(); + + /** + * bool full_transaction = 3; + */ + boolean getFullTransaction(); +} diff --git a/src/main/java/bdchain/api/grpc/GetBlockByNumberRequest.java b/src/main/java/bdchain/api/grpc/GetBlockByNumberRequest.java new file mode 100644 index 0000000..fd431a6 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetBlockByNumberRequest.java @@ -0,0 +1,659 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.GetBlockByNumberRequest} + */ +public final class GetBlockByNumberRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.GetBlockByNumberRequest) + GetBlockByNumberRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetBlockByNumberRequest.newBuilder() to construct. + private GetBlockByNumberRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetBlockByNumberRequest() { + ledger_ = ""; + number_ = 0L; + fullTransaction_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetBlockByNumberRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + ledger_ = s; + break; + } + case 16: { + + number_ = input.readUInt64(); + break; + } + case 24: { + + fullTransaction_ = input.readBool(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetBlockByNumberRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetBlockByNumberRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetBlockByNumberRequest.class, bdchain.api.grpc.GetBlockByNumberRequest.Builder.class); + } + + public static final int LEDGER_FIELD_NUMBER = 1; + private volatile java.lang.Object ledger_; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NUMBER_FIELD_NUMBER = 2; + private long number_; + /** + * uint64 number = 2; + */ + public long getNumber() { + return number_; + } + + public static final int FULL_TRANSACTION_FIELD_NUMBER = 3; + private boolean fullTransaction_; + /** + * bool full_transaction = 3; + */ + public boolean getFullTransaction() { + return fullTransaction_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLedgerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ledger_); + } + if (number_ != 0L) { + output.writeUInt64(2, number_); + } + if (fullTransaction_ != false) { + output.writeBool(3, fullTransaction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLedgerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ledger_); + } + if (number_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, number_); + } + if (fullTransaction_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, fullTransaction_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.GetBlockByNumberRequest)) { + return super.equals(obj); + } + bdchain.api.grpc.GetBlockByNumberRequest other = (bdchain.api.grpc.GetBlockByNumberRequest) obj; + + boolean result = true; + result = result && getLedger() + .equals(other.getLedger()); + result = result && (getNumber() + == other.getNumber()); + result = result && (getFullTransaction() + == other.getFullTransaction()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LEDGER_FIELD_NUMBER; + hash = (53 * hash) + getLedger().hashCode(); + hash = (37 * hash) + NUMBER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumber()); + hash = (37 * hash) + FULL_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFullTransaction()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.GetBlockByNumberRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetBlockByNumberRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.GetBlockByNumberRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.GetBlockByNumberRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.GetBlockByNumberRequest) + bdchain.api.grpc.GetBlockByNumberRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetBlockByNumberRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetBlockByNumberRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetBlockByNumberRequest.class, bdchain.api.grpc.GetBlockByNumberRequest.Builder.class); + } + + // Construct using bdchain.api.grpc.GetBlockByNumberRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ledger_ = ""; + + number_ = 0L; + + fullTransaction_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetBlockByNumberRequest_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.GetBlockByNumberRequest getDefaultInstanceForType() { + return bdchain.api.grpc.GetBlockByNumberRequest.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.GetBlockByNumberRequest build() { + bdchain.api.grpc.GetBlockByNumberRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.GetBlockByNumberRequest buildPartial() { + bdchain.api.grpc.GetBlockByNumberRequest result = new bdchain.api.grpc.GetBlockByNumberRequest(this); + result.ledger_ = ledger_; + result.number_ = number_; + result.fullTransaction_ = fullTransaction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.GetBlockByNumberRequest) { + return mergeFrom((bdchain.api.grpc.GetBlockByNumberRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.GetBlockByNumberRequest other) { + if (other == bdchain.api.grpc.GetBlockByNumberRequest.getDefaultInstance()) return this; + if (!other.getLedger().isEmpty()) { + ledger_ = other.ledger_; + onChanged(); + } + if (other.getNumber() != 0L) { + setNumber(other.getNumber()); + } + if (other.getFullTransaction() != false) { + setFullTransaction(other.getFullTransaction()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.GetBlockByNumberRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.GetBlockByNumberRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ledger_ = ""; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string ledger = 1; + */ + public Builder setLedger( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ledger_ = value; + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder clearLedger() { + + ledger_ = getDefaultInstance().getLedger(); + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder setLedgerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ledger_ = value; + onChanged(); + return this; + } + + private long number_ ; + /** + * uint64 number = 2; + */ + public long getNumber() { + return number_; + } + /** + * uint64 number = 2; + */ + public Builder setNumber(long value) { + + number_ = value; + onChanged(); + return this; + } + /** + * uint64 number = 2; + */ + public Builder clearNumber() { + + number_ = 0L; + onChanged(); + return this; + } + + private boolean fullTransaction_ ; + /** + * bool full_transaction = 3; + */ + public boolean getFullTransaction() { + return fullTransaction_; + } + /** + * bool full_transaction = 3; + */ + public Builder setFullTransaction(boolean value) { + + fullTransaction_ = value; + onChanged(); + return this; + } + /** + * bool full_transaction = 3; + */ + public Builder clearFullTransaction() { + + fullTransaction_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.GetBlockByNumberRequest) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.GetBlockByNumberRequest) + private static final bdchain.api.grpc.GetBlockByNumberRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.GetBlockByNumberRequest(); + } + + public static bdchain.api.grpc.GetBlockByNumberRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBlockByNumberRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBlockByNumberRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.GetBlockByNumberRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/GetBlockByNumberRequestOrBuilder.java b/src/main/java/bdchain/api/grpc/GetBlockByNumberRequestOrBuilder.java new file mode 100644 index 0000000..559b7f5 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetBlockByNumberRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +public interface GetBlockByNumberRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.GetBlockByNumberRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string ledger = 1; + */ + java.lang.String getLedger(); + /** + * string ledger = 1; + */ + com.google.protobuf.ByteString + getLedgerBytes(); + + /** + * uint64 number = 2; + */ + long getNumber(); + + /** + * bool full_transaction = 3; + */ + boolean getFullTransaction(); +} diff --git a/src/main/java/bdchain/api/grpc/GetLedgersResponse.java b/src/main/java/bdchain/api/grpc/GetLedgersResponse.java new file mode 100644 index 0000000..be8a352 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetLedgersResponse.java @@ -0,0 +1,586 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.GetLedgersResponse} + */ +public final class GetLedgersResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.GetLedgersResponse) + GetLedgersResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetLedgersResponse.newBuilder() to construct. + private GetLedgersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetLedgersResponse() { + ledgers_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetLedgersResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + ledgers_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + ledgers_.add(s); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + ledgers_ = ledgers_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_GetLedgersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_GetLedgersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetLedgersResponse.class, bdchain.api.grpc.GetLedgersResponse.Builder.class); + } + + public static final int LEDGERS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList ledgers_; + /** + * repeated string ledgers = 1; + */ + public com.google.protobuf.ProtocolStringList + getLedgersList() { + return ledgers_; + } + /** + * repeated string ledgers = 1; + */ + public int getLedgersCount() { + return ledgers_.size(); + } + /** + * repeated string ledgers = 1; + */ + public java.lang.String getLedgers(int index) { + return ledgers_.get(index); + } + /** + * repeated string ledgers = 1; + */ + public com.google.protobuf.ByteString + getLedgersBytes(int index) { + return ledgers_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < ledgers_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ledgers_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < ledgers_.size(); i++) { + dataSize += computeStringSizeNoTag(ledgers_.getRaw(i)); + } + size += dataSize; + size += 1 * getLedgersList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.GetLedgersResponse)) { + return super.equals(obj); + } + bdchain.api.grpc.GetLedgersResponse other = (bdchain.api.grpc.GetLedgersResponse) obj; + + boolean result = true; + result = result && getLedgersList() + .equals(other.getLedgersList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLedgersCount() > 0) { + hash = (37 * hash) + LEDGERS_FIELD_NUMBER; + hash = (53 * hash) + getLedgersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.GetLedgersResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetLedgersResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetLedgersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetLedgersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetLedgersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetLedgersResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetLedgersResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetLedgersResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetLedgersResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetLedgersResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetLedgersResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetLedgersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.GetLedgersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.GetLedgersResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.GetLedgersResponse) + bdchain.api.grpc.GetLedgersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_GetLedgersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_GetLedgersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetLedgersResponse.class, bdchain.api.grpc.GetLedgersResponse.Builder.class); + } + + // Construct using bdchain.api.grpc.GetLedgersResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ledgers_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_GetLedgersResponse_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.GetLedgersResponse getDefaultInstanceForType() { + return bdchain.api.grpc.GetLedgersResponse.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.GetLedgersResponse build() { + bdchain.api.grpc.GetLedgersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.GetLedgersResponse buildPartial() { + bdchain.api.grpc.GetLedgersResponse result = new bdchain.api.grpc.GetLedgersResponse(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + ledgers_ = ledgers_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ledgers_ = ledgers_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.GetLedgersResponse) { + return mergeFrom((bdchain.api.grpc.GetLedgersResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.GetLedgersResponse other) { + if (other == bdchain.api.grpc.GetLedgersResponse.getDefaultInstance()) return this; + if (!other.ledgers_.isEmpty()) { + if (ledgers_.isEmpty()) { + ledgers_ = other.ledgers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLedgersIsMutable(); + ledgers_.addAll(other.ledgers_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.GetLedgersResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.GetLedgersResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList ledgers_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureLedgersIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + ledgers_ = new com.google.protobuf.LazyStringArrayList(ledgers_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated string ledgers = 1; + */ + public com.google.protobuf.ProtocolStringList + getLedgersList() { + return ledgers_.getUnmodifiableView(); + } + /** + * repeated string ledgers = 1; + */ + public int getLedgersCount() { + return ledgers_.size(); + } + /** + * repeated string ledgers = 1; + */ + public java.lang.String getLedgers(int index) { + return ledgers_.get(index); + } + /** + * repeated string ledgers = 1; + */ + public com.google.protobuf.ByteString + getLedgersBytes(int index) { + return ledgers_.getByteString(index); + } + /** + * repeated string ledgers = 1; + */ + public Builder setLedgers( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLedgersIsMutable(); + ledgers_.set(index, value); + onChanged(); + return this; + } + /** + * repeated string ledgers = 1; + */ + public Builder addLedgers( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLedgersIsMutable(); + ledgers_.add(value); + onChanged(); + return this; + } + /** + * repeated string ledgers = 1; + */ + public Builder addAllLedgers( + java.lang.Iterable values) { + ensureLedgersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, ledgers_); + onChanged(); + return this; + } + /** + * repeated string ledgers = 1; + */ + public Builder clearLedgers() { + ledgers_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * repeated string ledgers = 1; + */ + public Builder addLedgersBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLedgersIsMutable(); + ledgers_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.GetLedgersResponse) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.GetLedgersResponse) + private static final bdchain.api.grpc.GetLedgersResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.GetLedgersResponse(); + } + + public static bdchain.api.grpc.GetLedgersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetLedgersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetLedgersResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.GetLedgersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/GetLedgersResponseOrBuilder.java b/src/main/java/bdchain/api/grpc/GetLedgersResponseOrBuilder.java new file mode 100644 index 0000000..49cd761 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetLedgersResponseOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +public interface GetLedgersResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.GetLedgersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string ledgers = 1; + */ + java.util.List + getLedgersList(); + /** + * repeated string ledgers = 1; + */ + int getLedgersCount(); + /** + * repeated string ledgers = 1; + */ + java.lang.String getLedgers(int index); + /** + * repeated string ledgers = 1; + */ + com.google.protobuf.ByteString + getLedgersBytes(int index); +} diff --git a/src/main/java/bdchain/api/grpc/GetTransactionByBlockHashAndIndexRequest.java b/src/main/java/bdchain/api/grpc/GetTransactionByBlockHashAndIndexRequest.java new file mode 100644 index 0000000..4e8a907 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetTransactionByBlockHashAndIndexRequest.java @@ -0,0 +1,660 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.GetTransactionByBlockHashAndIndexRequest} + */ +public final class GetTransactionByBlockHashAndIndexRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.GetTransactionByBlockHashAndIndexRequest) + GetTransactionByBlockHashAndIndexRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetTransactionByBlockHashAndIndexRequest.newBuilder() to construct. + private GetTransactionByBlockHashAndIndexRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetTransactionByBlockHashAndIndexRequest() { + ledger_ = ""; + blockHash_ = com.google.protobuf.ByteString.EMPTY; + index_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetTransactionByBlockHashAndIndexRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + ledger_ = s; + break; + } + case 18: { + + blockHash_ = input.readBytes(); + break; + } + case 24: { + + index_ = input.readUInt32(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByBlockHashAndIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByBlockHashAndIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest.class, bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest.Builder.class); + } + + public static final int LEDGER_FIELD_NUMBER = 1; + private volatile java.lang.Object ledger_; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BLOCK_HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString blockHash_; + /** + * bytes block_hash = 2; + */ + public com.google.protobuf.ByteString getBlockHash() { + return blockHash_; + } + + public static final int INDEX_FIELD_NUMBER = 3; + private int index_; + /** + * uint32 index = 3; + */ + public int getIndex() { + return index_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLedgerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ledger_); + } + if (!blockHash_.isEmpty()) { + output.writeBytes(2, blockHash_); + } + if (index_ != 0) { + output.writeUInt32(3, index_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLedgerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ledger_); + } + if (!blockHash_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, blockHash_); + } + if (index_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, index_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest)) { + return super.equals(obj); + } + bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest other = (bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest) obj; + + boolean result = true; + result = result && getLedger() + .equals(other.getLedger()); + result = result && getBlockHash() + .equals(other.getBlockHash()); + result = result && (getIndex() + == other.getIndex()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LEDGER_FIELD_NUMBER; + hash = (53 * hash) + getLedger().hashCode(); + hash = (37 * hash) + BLOCK_HASH_FIELD_NUMBER; + hash = (53 * hash) + getBlockHash().hashCode(); + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.GetTransactionByBlockHashAndIndexRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.GetTransactionByBlockHashAndIndexRequest) + bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByBlockHashAndIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByBlockHashAndIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest.class, bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest.Builder.class); + } + + // Construct using bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ledger_ = ""; + + blockHash_ = com.google.protobuf.ByteString.EMPTY; + + index_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByBlockHashAndIndexRequest_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest getDefaultInstanceForType() { + return bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest build() { + bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest buildPartial() { + bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest result = new bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest(this); + result.ledger_ = ledger_; + result.blockHash_ = blockHash_; + result.index_ = index_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest) { + return mergeFrom((bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest other) { + if (other == bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest.getDefaultInstance()) return this; + if (!other.getLedger().isEmpty()) { + ledger_ = other.ledger_; + onChanged(); + } + if (other.getBlockHash() != com.google.protobuf.ByteString.EMPTY) { + setBlockHash(other.getBlockHash()); + } + if (other.getIndex() != 0) { + setIndex(other.getIndex()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ledger_ = ""; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string ledger = 1; + */ + public Builder setLedger( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ledger_ = value; + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder clearLedger() { + + ledger_ = getDefaultInstance().getLedger(); + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder setLedgerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ledger_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString blockHash_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes block_hash = 2; + */ + public com.google.protobuf.ByteString getBlockHash() { + return blockHash_; + } + /** + * bytes block_hash = 2; + */ + public Builder setBlockHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + blockHash_ = value; + onChanged(); + return this; + } + /** + * bytes block_hash = 2; + */ + public Builder clearBlockHash() { + + blockHash_ = getDefaultInstance().getBlockHash(); + onChanged(); + return this; + } + + private int index_ ; + /** + * uint32 index = 3; + */ + public int getIndex() { + return index_; + } + /** + * uint32 index = 3; + */ + public Builder setIndex(int value) { + + index_ = value; + onChanged(); + return this; + } + /** + * uint32 index = 3; + */ + public Builder clearIndex() { + + index_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.GetTransactionByBlockHashAndIndexRequest) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.GetTransactionByBlockHashAndIndexRequest) + private static final bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest(); + } + + public static bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTransactionByBlockHashAndIndexRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetTransactionByBlockHashAndIndexRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByBlockHashAndIndexRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/GetTransactionByBlockHashAndIndexRequestOrBuilder.java b/src/main/java/bdchain/api/grpc/GetTransactionByBlockHashAndIndexRequestOrBuilder.java new file mode 100644 index 0000000..d1987c9 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetTransactionByBlockHashAndIndexRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +public interface GetTransactionByBlockHashAndIndexRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.GetTransactionByBlockHashAndIndexRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string ledger = 1; + */ + java.lang.String getLedger(); + /** + * string ledger = 1; + */ + com.google.protobuf.ByteString + getLedgerBytes(); + + /** + * bytes block_hash = 2; + */ + com.google.protobuf.ByteString getBlockHash(); + + /** + * uint32 index = 3; + */ + int getIndex(); +} diff --git a/src/main/java/bdchain/api/grpc/GetTransactionByBlockNumberAndIndexRequest.java b/src/main/java/bdchain/api/grpc/GetTransactionByBlockNumberAndIndexRequest.java new file mode 100644 index 0000000..41d361d --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetTransactionByBlockNumberAndIndexRequest.java @@ -0,0 +1,658 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.GetTransactionByBlockNumberAndIndexRequest} + */ +public final class GetTransactionByBlockNumberAndIndexRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.GetTransactionByBlockNumberAndIndexRequest) + GetTransactionByBlockNumberAndIndexRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetTransactionByBlockNumberAndIndexRequest.newBuilder() to construct. + private GetTransactionByBlockNumberAndIndexRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetTransactionByBlockNumberAndIndexRequest() { + ledger_ = ""; + blockNumber_ = 0L; + index_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetTransactionByBlockNumberAndIndexRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + ledger_ = s; + break; + } + case 16: { + + blockNumber_ = input.readUInt64(); + break; + } + case 24: { + + index_ = input.readUInt32(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByBlockNumberAndIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByBlockNumberAndIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest.class, bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest.Builder.class); + } + + public static final int LEDGER_FIELD_NUMBER = 1; + private volatile java.lang.Object ledger_; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BLOCK_NUMBER_FIELD_NUMBER = 2; + private long blockNumber_; + /** + * uint64 block_number = 2; + */ + public long getBlockNumber() { + return blockNumber_; + } + + public static final int INDEX_FIELD_NUMBER = 3; + private int index_; + /** + * uint32 index = 3; + */ + public int getIndex() { + return index_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLedgerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ledger_); + } + if (blockNumber_ != 0L) { + output.writeUInt64(2, blockNumber_); + } + if (index_ != 0) { + output.writeUInt32(3, index_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLedgerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ledger_); + } + if (blockNumber_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, blockNumber_); + } + if (index_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, index_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest)) { + return super.equals(obj); + } + bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest other = (bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest) obj; + + boolean result = true; + result = result && getLedger() + .equals(other.getLedger()); + result = result && (getBlockNumber() + == other.getBlockNumber()); + result = result && (getIndex() + == other.getIndex()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LEDGER_FIELD_NUMBER; + hash = (53 * hash) + getLedger().hashCode(); + hash = (37 * hash) + BLOCK_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBlockNumber()); + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.GetTransactionByBlockNumberAndIndexRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.GetTransactionByBlockNumberAndIndexRequest) + bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByBlockNumberAndIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByBlockNumberAndIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest.class, bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest.Builder.class); + } + + // Construct using bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ledger_ = ""; + + blockNumber_ = 0L; + + index_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByBlockNumberAndIndexRequest_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest getDefaultInstanceForType() { + return bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest build() { + bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest buildPartial() { + bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest result = new bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest(this); + result.ledger_ = ledger_; + result.blockNumber_ = blockNumber_; + result.index_ = index_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest) { + return mergeFrom((bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest other) { + if (other == bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest.getDefaultInstance()) return this; + if (!other.getLedger().isEmpty()) { + ledger_ = other.ledger_; + onChanged(); + } + if (other.getBlockNumber() != 0L) { + setBlockNumber(other.getBlockNumber()); + } + if (other.getIndex() != 0) { + setIndex(other.getIndex()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ledger_ = ""; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string ledger = 1; + */ + public Builder setLedger( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ledger_ = value; + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder clearLedger() { + + ledger_ = getDefaultInstance().getLedger(); + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder setLedgerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ledger_ = value; + onChanged(); + return this; + } + + private long blockNumber_ ; + /** + * uint64 block_number = 2; + */ + public long getBlockNumber() { + return blockNumber_; + } + /** + * uint64 block_number = 2; + */ + public Builder setBlockNumber(long value) { + + blockNumber_ = value; + onChanged(); + return this; + } + /** + * uint64 block_number = 2; + */ + public Builder clearBlockNumber() { + + blockNumber_ = 0L; + onChanged(); + return this; + } + + private int index_ ; + /** + * uint32 index = 3; + */ + public int getIndex() { + return index_; + } + /** + * uint32 index = 3; + */ + public Builder setIndex(int value) { + + index_ = value; + onChanged(); + return this; + } + /** + * uint32 index = 3; + */ + public Builder clearIndex() { + + index_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.GetTransactionByBlockNumberAndIndexRequest) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.GetTransactionByBlockNumberAndIndexRequest) + private static final bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest(); + } + + public static bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTransactionByBlockNumberAndIndexRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetTransactionByBlockNumberAndIndexRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByBlockNumberAndIndexRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/GetTransactionByBlockNumberAndIndexRequestOrBuilder.java b/src/main/java/bdchain/api/grpc/GetTransactionByBlockNumberAndIndexRequestOrBuilder.java new file mode 100644 index 0000000..ed46bdb --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetTransactionByBlockNumberAndIndexRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +public interface GetTransactionByBlockNumberAndIndexRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.GetTransactionByBlockNumberAndIndexRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string ledger = 1; + */ + java.lang.String getLedger(); + /** + * string ledger = 1; + */ + com.google.protobuf.ByteString + getLedgerBytes(); + + /** + * uint64 block_number = 2; + */ + long getBlockNumber(); + + /** + * uint32 index = 3; + */ + int getIndex(); +} diff --git a/src/main/java/bdchain/api/grpc/GetTransactionByHashRequest.java b/src/main/java/bdchain/api/grpc/GetTransactionByHashRequest.java new file mode 100644 index 0000000..42e1cf6 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetTransactionByHashRequest.java @@ -0,0 +1,602 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.GetTransactionByHashRequest} + */ +public final class GetTransactionByHashRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.GetTransactionByHashRequest) + GetTransactionByHashRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetTransactionByHashRequest.newBuilder() to construct. + private GetTransactionByHashRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetTransactionByHashRequest() { + ledger_ = ""; + hash_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetTransactionByHashRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + ledger_ = s; + break; + } + case 18: { + + hash_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByHashRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByHashRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetTransactionByHashRequest.class, bdchain.api.grpc.GetTransactionByHashRequest.Builder.class); + } + + public static final int LEDGER_FIELD_NUMBER = 1; + private volatile java.lang.Object ledger_; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 2; + */ + public com.google.protobuf.ByteString getHash() { + return hash_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLedgerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ledger_); + } + if (!hash_.isEmpty()) { + output.writeBytes(2, hash_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLedgerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ledger_); + } + if (!hash_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, hash_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.GetTransactionByHashRequest)) { + return super.equals(obj); + } + bdchain.api.grpc.GetTransactionByHashRequest other = (bdchain.api.grpc.GetTransactionByHashRequest) obj; + + boolean result = true; + result = result && getLedger() + .equals(other.getLedger()); + result = result && getHash() + .equals(other.getHash()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LEDGER_FIELD_NUMBER; + hash = (53 * hash) + getLedger().hashCode(); + hash = (37 * hash) + HASH_FIELD_NUMBER; + hash = (53 * hash) + getHash().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.GetTransactionByHashRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.GetTransactionByHashRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.GetTransactionByHashRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.GetTransactionByHashRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.GetTransactionByHashRequest) + bdchain.api.grpc.GetTransactionByHashRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByHashRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByHashRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.GetTransactionByHashRequest.class, bdchain.api.grpc.GetTransactionByHashRequest.Builder.class); + } + + // Construct using bdchain.api.grpc.GetTransactionByHashRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ledger_ = ""; + + hash_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_GetTransactionByHashRequest_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByHashRequest getDefaultInstanceForType() { + return bdchain.api.grpc.GetTransactionByHashRequest.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByHashRequest build() { + bdchain.api.grpc.GetTransactionByHashRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByHashRequest buildPartial() { + bdchain.api.grpc.GetTransactionByHashRequest result = new bdchain.api.grpc.GetTransactionByHashRequest(this); + result.ledger_ = ledger_; + result.hash_ = hash_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.GetTransactionByHashRequest) { + return mergeFrom((bdchain.api.grpc.GetTransactionByHashRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.GetTransactionByHashRequest other) { + if (other == bdchain.api.grpc.GetTransactionByHashRequest.getDefaultInstance()) return this; + if (!other.getLedger().isEmpty()) { + ledger_ = other.ledger_; + onChanged(); + } + if (other.getHash() != com.google.protobuf.ByteString.EMPTY) { + setHash(other.getHash()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.GetTransactionByHashRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.GetTransactionByHashRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ledger_ = ""; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string ledger = 1; + */ + public Builder setLedger( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ledger_ = value; + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder clearLedger() { + + ledger_ = getDefaultInstance().getLedger(); + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder setLedgerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ledger_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes hash = 2; + */ + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 2; + */ + public Builder setHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + hash_ = value; + onChanged(); + return this; + } + /** + * bytes hash = 2; + */ + public Builder clearHash() { + + hash_ = getDefaultInstance().getHash(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.GetTransactionByHashRequest) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.GetTransactionByHashRequest) + private static final bdchain.api.grpc.GetTransactionByHashRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.GetTransactionByHashRequest(); + } + + public static bdchain.api.grpc.GetTransactionByHashRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTransactionByHashRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetTransactionByHashRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.GetTransactionByHashRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/GetTransactionByHashRequestOrBuilder.java b/src/main/java/bdchain/api/grpc/GetTransactionByHashRequestOrBuilder.java new file mode 100644 index 0000000..c4376de --- /dev/null +++ b/src/main/java/bdchain/api/grpc/GetTransactionByHashRequestOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +public interface GetTransactionByHashRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.GetTransactionByHashRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string ledger = 1; + */ + java.lang.String getLedger(); + /** + * string ledger = 1; + */ + com.google.protobuf.ByteString + getLedgerBytes(); + + /** + * bytes hash = 2; + */ + com.google.protobuf.ByteString getHash(); +} diff --git a/src/main/java/bdchain/api/grpc/SendTransactionRequest.java b/src/main/java/bdchain/api/grpc/SendTransactionRequest.java new file mode 100644 index 0000000..690b26f --- /dev/null +++ b/src/main/java/bdchain/api/grpc/SendTransactionRequest.java @@ -0,0 +1,1427 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.SendTransactionRequest} + */ +public final class SendTransactionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.SendTransactionRequest) + SendTransactionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use SendTransactionRequest.newBuilder() to construct. + private SendTransactionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SendTransactionRequest() { + ledger_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SendTransactionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + ledger_ = s; + break; + } + case 18: { + bdchain.api.grpc.SendTransactionRequest.Transaction.Builder subBuilder = null; + if (transaction_ != null) { + subBuilder = transaction_.toBuilder(); + } + transaction_ = input.readMessage(bdchain.api.grpc.SendTransactionRequest.Transaction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(transaction_); + transaction_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.SendTransactionRequest.class, bdchain.api.grpc.SendTransactionRequest.Builder.class); + } + + public interface TransactionOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.SendTransactionRequest.Transaction) + com.google.protobuf.MessageOrBuilder { + + /** + * .bdchain.api.TransactionType type = 1; + */ + int getTypeValue(); + /** + * .bdchain.api.TransactionType type = 1; + */ + bdchain.api.grpc.TransactionType getType(); + + /** + * bytes from = 2; + */ + com.google.protobuf.ByteString getFrom(); + + /** + * bytes to = 3; + */ + com.google.protobuf.ByteString getTo(); + + /** + * bytes data = 4; + */ + com.google.protobuf.ByteString getData(); + } + /** + * Protobuf type {@code bdchain.api.SendTransactionRequest.Transaction} + */ + public static final class Transaction extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.SendTransactionRequest.Transaction) + TransactionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Transaction.newBuilder() to construct. + private Transaction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Transaction() { + type_ = 0; + from_ = com.google.protobuf.ByteString.EMPTY; + to_ = com.google.protobuf.ByteString.EMPTY; + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Transaction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 18: { + + from_ = input.readBytes(); + break; + } + case 26: { + + to_ = input.readBytes(); + break; + } + case 34: { + + data_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionRequest_Transaction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionRequest_Transaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.SendTransactionRequest.Transaction.class, bdchain.api.grpc.SendTransactionRequest.Transaction.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * .bdchain.api.TransactionType type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + * .bdchain.api.TransactionType type = 1; + */ + public bdchain.api.grpc.TransactionType getType() { + @SuppressWarnings("deprecation") + bdchain.api.grpc.TransactionType result = bdchain.api.grpc.TransactionType.valueOf(type_); + return result == null ? bdchain.api.grpc.TransactionType.UNRECOGNIZED : result; + } + + public static final int FROM_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString from_; + /** + * bytes from = 2; + */ + public com.google.protobuf.ByteString getFrom() { + return from_; + } + + public static final int TO_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString to_; + /** + * bytes to = 3; + */ + public com.google.protobuf.ByteString getTo() { + return to_; + } + + public static final int DATA_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString data_; + /** + * bytes data = 4; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (type_ != bdchain.api.grpc.TransactionType.RECORD.getNumber()) { + output.writeEnum(1, type_); + } + if (!from_.isEmpty()) { + output.writeBytes(2, from_); + } + if (!to_.isEmpty()) { + output.writeBytes(3, to_); + } + if (!data_.isEmpty()) { + output.writeBytes(4, data_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != bdchain.api.grpc.TransactionType.RECORD.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (!from_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, from_); + } + if (!to_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, to_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, data_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.SendTransactionRequest.Transaction)) { + return super.equals(obj); + } + bdchain.api.grpc.SendTransactionRequest.Transaction other = (bdchain.api.grpc.SendTransactionRequest.Transaction) obj; + + boolean result = true; + result = result && type_ == other.type_; + result = result && getFrom() + .equals(other.getFrom()); + result = result && getTo() + .equals(other.getTo()); + result = result && getData() + .equals(other.getData()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + FROM_FIELD_NUMBER; + hash = (53 * hash) + getFrom().hashCode(); + hash = (37 * hash) + TO_FIELD_NUMBER; + hash = (53 * hash) + getTo().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.SendTransactionRequest.Transaction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.SendTransactionRequest.Transaction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.SendTransactionRequest.Transaction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.SendTransactionRequest.Transaction) + bdchain.api.grpc.SendTransactionRequest.TransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionRequest_Transaction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionRequest_Transaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.SendTransactionRequest.Transaction.class, bdchain.api.grpc.SendTransactionRequest.Transaction.Builder.class); + } + + // Construct using bdchain.api.grpc.SendTransactionRequest.Transaction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = 0; + + from_ = com.google.protobuf.ByteString.EMPTY; + + to_ = com.google.protobuf.ByteString.EMPTY; + + data_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionRequest_Transaction_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionRequest.Transaction getDefaultInstanceForType() { + return bdchain.api.grpc.SendTransactionRequest.Transaction.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionRequest.Transaction build() { + bdchain.api.grpc.SendTransactionRequest.Transaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionRequest.Transaction buildPartial() { + bdchain.api.grpc.SendTransactionRequest.Transaction result = new bdchain.api.grpc.SendTransactionRequest.Transaction(this); + result.type_ = type_; + result.from_ = from_; + result.to_ = to_; + result.data_ = data_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.SendTransactionRequest.Transaction) { + return mergeFrom((bdchain.api.grpc.SendTransactionRequest.Transaction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.SendTransactionRequest.Transaction other) { + if (other == bdchain.api.grpc.SendTransactionRequest.Transaction.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.getFrom() != com.google.protobuf.ByteString.EMPTY) { + setFrom(other.getFrom()); + } + if (other.getTo() != com.google.protobuf.ByteString.EMPTY) { + setTo(other.getTo()); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.SendTransactionRequest.Transaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.SendTransactionRequest.Transaction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + * .bdchain.api.TransactionType type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + * .bdchain.api.TransactionType type = 1; + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + * .bdchain.api.TransactionType type = 1; + */ + public bdchain.api.grpc.TransactionType getType() { + @SuppressWarnings("deprecation") + bdchain.api.grpc.TransactionType result = bdchain.api.grpc.TransactionType.valueOf(type_); + return result == null ? bdchain.api.grpc.TransactionType.UNRECOGNIZED : result; + } + /** + * .bdchain.api.TransactionType type = 1; + */ + public Builder setType(bdchain.api.grpc.TransactionType value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .bdchain.api.TransactionType type = 1; + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString from_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes from = 2; + */ + public com.google.protobuf.ByteString getFrom() { + return from_; + } + /** + * bytes from = 2; + */ + public Builder setFrom(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + from_ = value; + onChanged(); + return this; + } + /** + * bytes from = 2; + */ + public Builder clearFrom() { + + from_ = getDefaultInstance().getFrom(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString to_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes to = 3; + */ + public com.google.protobuf.ByteString getTo() { + return to_; + } + /** + * bytes to = 3; + */ + public Builder setTo(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + to_ = value; + onChanged(); + return this; + } + /** + * bytes to = 3; + */ + public Builder clearTo() { + + to_ = getDefaultInstance().getTo(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes data = 4; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * bytes data = 4; + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + * bytes data = 4; + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.SendTransactionRequest.Transaction) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.SendTransactionRequest.Transaction) + private static final bdchain.api.grpc.SendTransactionRequest.Transaction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.SendTransactionRequest.Transaction(); + } + + public static bdchain.api.grpc.SendTransactionRequest.Transaction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Transaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Transaction(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionRequest.Transaction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int LEDGER_FIELD_NUMBER = 1; + private volatile java.lang.Object ledger_; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRANSACTION_FIELD_NUMBER = 2; + private bdchain.api.grpc.SendTransactionRequest.Transaction transaction_; + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public boolean hasTransaction() { + return transaction_ != null; + } + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public bdchain.api.grpc.SendTransactionRequest.Transaction getTransaction() { + return transaction_ == null ? bdchain.api.grpc.SendTransactionRequest.Transaction.getDefaultInstance() : transaction_; + } + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public bdchain.api.grpc.SendTransactionRequest.TransactionOrBuilder getTransactionOrBuilder() { + return getTransaction(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLedgerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ledger_); + } + if (transaction_ != null) { + output.writeMessage(2, getTransaction()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLedgerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ledger_); + } + if (transaction_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTransaction()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.SendTransactionRequest)) { + return super.equals(obj); + } + bdchain.api.grpc.SendTransactionRequest other = (bdchain.api.grpc.SendTransactionRequest) obj; + + boolean result = true; + result = result && getLedger() + .equals(other.getLedger()); + result = result && (hasTransaction() == other.hasTransaction()); + if (hasTransaction()) { + result = result && getTransaction() + .equals(other.getTransaction()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LEDGER_FIELD_NUMBER; + hash = (53 * hash) + getLedger().hashCode(); + if (hasTransaction()) { + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.SendTransactionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.SendTransactionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.SendTransactionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.SendTransactionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.SendTransactionRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.SendTransactionRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.SendTransactionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.SendTransactionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.SendTransactionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.SendTransactionRequest) + bdchain.api.grpc.SendTransactionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.SendTransactionRequest.class, bdchain.api.grpc.SendTransactionRequest.Builder.class); + } + + // Construct using bdchain.api.grpc.SendTransactionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ledger_ = ""; + + if (transactionBuilder_ == null) { + transaction_ = null; + } else { + transaction_ = null; + transactionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionRequest_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionRequest getDefaultInstanceForType() { + return bdchain.api.grpc.SendTransactionRequest.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionRequest build() { + bdchain.api.grpc.SendTransactionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionRequest buildPartial() { + bdchain.api.grpc.SendTransactionRequest result = new bdchain.api.grpc.SendTransactionRequest(this); + result.ledger_ = ledger_; + if (transactionBuilder_ == null) { + result.transaction_ = transaction_; + } else { + result.transaction_ = transactionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.SendTransactionRequest) { + return mergeFrom((bdchain.api.grpc.SendTransactionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.SendTransactionRequest other) { + if (other == bdchain.api.grpc.SendTransactionRequest.getDefaultInstance()) return this; + if (!other.getLedger().isEmpty()) { + ledger_ = other.ledger_; + onChanged(); + } + if (other.hasTransaction()) { + mergeTransaction(other.getTransaction()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.SendTransactionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.SendTransactionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ledger_ = ""; + /** + * string ledger = 1; + */ + public java.lang.String getLedger() { + java.lang.Object ref = ledger_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ledger_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string ledger = 1; + */ + public com.google.protobuf.ByteString + getLedgerBytes() { + java.lang.Object ref = ledger_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ledger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string ledger = 1; + */ + public Builder setLedger( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ledger_ = value; + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder clearLedger() { + + ledger_ = getDefaultInstance().getLedger(); + onChanged(); + return this; + } + /** + * string ledger = 1; + */ + public Builder setLedgerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ledger_ = value; + onChanged(); + return this; + } + + private bdchain.api.grpc.SendTransactionRequest.Transaction transaction_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + bdchain.api.grpc.SendTransactionRequest.Transaction, bdchain.api.grpc.SendTransactionRequest.Transaction.Builder, bdchain.api.grpc.SendTransactionRequest.TransactionOrBuilder> transactionBuilder_; + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public boolean hasTransaction() { + return transactionBuilder_ != null || transaction_ != null; + } + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public bdchain.api.grpc.SendTransactionRequest.Transaction getTransaction() { + if (transactionBuilder_ == null) { + return transaction_ == null ? bdchain.api.grpc.SendTransactionRequest.Transaction.getDefaultInstance() : transaction_; + } else { + return transactionBuilder_.getMessage(); + } + } + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public Builder setTransaction(bdchain.api.grpc.SendTransactionRequest.Transaction value) { + if (transactionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transaction_ = value; + onChanged(); + } else { + transactionBuilder_.setMessage(value); + } + + return this; + } + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public Builder setTransaction( + bdchain.api.grpc.SendTransactionRequest.Transaction.Builder builderForValue) { + if (transactionBuilder_ == null) { + transaction_ = builderForValue.build(); + onChanged(); + } else { + transactionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public Builder mergeTransaction(bdchain.api.grpc.SendTransactionRequest.Transaction value) { + if (transactionBuilder_ == null) { + if (transaction_ != null) { + transaction_ = + bdchain.api.grpc.SendTransactionRequest.Transaction.newBuilder(transaction_).mergeFrom(value).buildPartial(); + } else { + transaction_ = value; + } + onChanged(); + } else { + transactionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public Builder clearTransaction() { + if (transactionBuilder_ == null) { + transaction_ = null; + onChanged(); + } else { + transaction_ = null; + transactionBuilder_ = null; + } + + return this; + } + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public bdchain.api.grpc.SendTransactionRequest.Transaction.Builder getTransactionBuilder() { + + onChanged(); + return getTransactionFieldBuilder().getBuilder(); + } + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + public bdchain.api.grpc.SendTransactionRequest.TransactionOrBuilder getTransactionOrBuilder() { + if (transactionBuilder_ != null) { + return transactionBuilder_.getMessageOrBuilder(); + } else { + return transaction_ == null ? + bdchain.api.grpc.SendTransactionRequest.Transaction.getDefaultInstance() : transaction_; + } + } + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + bdchain.api.grpc.SendTransactionRequest.Transaction, bdchain.api.grpc.SendTransactionRequest.Transaction.Builder, bdchain.api.grpc.SendTransactionRequest.TransactionOrBuilder> + getTransactionFieldBuilder() { + if (transactionBuilder_ == null) { + transactionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + bdchain.api.grpc.SendTransactionRequest.Transaction, bdchain.api.grpc.SendTransactionRequest.Transaction.Builder, bdchain.api.grpc.SendTransactionRequest.TransactionOrBuilder>( + getTransaction(), + getParentForChildren(), + isClean()); + transaction_ = null; + } + return transactionBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.SendTransactionRequest) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.SendTransactionRequest) + private static final bdchain.api.grpc.SendTransactionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.SendTransactionRequest(); + } + + public static bdchain.api.grpc.SendTransactionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SendTransactionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SendTransactionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/SendTransactionRequestOrBuilder.java b/src/main/java/bdchain/api/grpc/SendTransactionRequestOrBuilder.java new file mode 100644 index 0000000..68094a6 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/SendTransactionRequestOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +public interface SendTransactionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.SendTransactionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string ledger = 1; + */ + java.lang.String getLedger(); + /** + * string ledger = 1; + */ + com.google.protobuf.ByteString + getLedgerBytes(); + + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + boolean hasTransaction(); + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + bdchain.api.grpc.SendTransactionRequest.Transaction getTransaction(); + /** + * .bdchain.api.SendTransactionRequest.Transaction transaction = 2; + */ + bdchain.api.grpc.SendTransactionRequest.TransactionOrBuilder getTransactionOrBuilder(); +} diff --git a/src/main/java/bdchain/api/grpc/SendTransactionResponse.java b/src/main/java/bdchain/api/grpc/SendTransactionResponse.java new file mode 100644 index 0000000..b3b1d0e --- /dev/null +++ b/src/main/java/bdchain/api/grpc/SendTransactionResponse.java @@ -0,0 +1,475 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.SendTransactionResponse} + */ +public final class SendTransactionResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.SendTransactionResponse) + SendTransactionResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use SendTransactionResponse.newBuilder() to construct. + private SendTransactionResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SendTransactionResponse() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SendTransactionResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + + hash_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.SendTransactionResponse.class, bdchain.api.grpc.SendTransactionResponse.Builder.class); + } + + public static final int HASH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 1; + */ + public com.google.protobuf.ByteString getHash() { + return hash_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!hash_.isEmpty()) { + output.writeBytes(1, hash_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!hash_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, hash_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.SendTransactionResponse)) { + return super.equals(obj); + } + bdchain.api.grpc.SendTransactionResponse other = (bdchain.api.grpc.SendTransactionResponse) obj; + + boolean result = true; + result = result && getHash() + .equals(other.getHash()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HASH_FIELD_NUMBER; + hash = (53 * hash) + getHash().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.SendTransactionResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.SendTransactionResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.SendTransactionResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.SendTransactionResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.SendTransactionResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.SendTransactionResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.SendTransactionResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.SendTransactionResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.SendTransactionResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.SendTransactionResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.SendTransactionResponse) + bdchain.api.grpc.SendTransactionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.SendTransactionResponse.class, bdchain.api.grpc.SendTransactionResponse.Builder.class); + } + + // Construct using bdchain.api.grpc.SendTransactionResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + hash_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.TransactionLedgerProto.internal_static_bdchain_api_SendTransactionResponse_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionResponse getDefaultInstanceForType() { + return bdchain.api.grpc.SendTransactionResponse.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionResponse build() { + bdchain.api.grpc.SendTransactionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionResponse buildPartial() { + bdchain.api.grpc.SendTransactionResponse result = new bdchain.api.grpc.SendTransactionResponse(this); + result.hash_ = hash_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.SendTransactionResponse) { + return mergeFrom((bdchain.api.grpc.SendTransactionResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.SendTransactionResponse other) { + if (other == bdchain.api.grpc.SendTransactionResponse.getDefaultInstance()) return this; + if (other.getHash() != com.google.protobuf.ByteString.EMPTY) { + setHash(other.getHash()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.SendTransactionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.SendTransactionResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes hash = 1; + */ + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 1; + */ + public Builder setHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + hash_ = value; + onChanged(); + return this; + } + /** + * bytes hash = 1; + */ + public Builder clearHash() { + + hash_ = getDefaultInstance().getHash(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.SendTransactionResponse) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.SendTransactionResponse) + private static final bdchain.api.grpc.SendTransactionResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.SendTransactionResponse(); + } + + public static bdchain.api.grpc.SendTransactionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SendTransactionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SendTransactionResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.SendTransactionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/SendTransactionResponseOrBuilder.java b/src/main/java/bdchain/api/grpc/SendTransactionResponseOrBuilder.java new file mode 100644 index 0000000..a24bc80 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/SendTransactionResponseOrBuilder.java @@ -0,0 +1,14 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +public interface SendTransactionResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.SendTransactionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes hash = 1; + */ + com.google.protobuf.ByteString getHash(); +} diff --git a/src/main/java/bdchain/api/grpc/Transaction.java b/src/main/java/bdchain/api/grpc/Transaction.java new file mode 100644 index 0000000..e7fd22d --- /dev/null +++ b/src/main/java/bdchain/api/grpc/Transaction.java @@ -0,0 +1,1367 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +/** + * Protobuf type {@code bdchain.api.Transaction} + */ +public final class Transaction extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:bdchain.api.Transaction) + TransactionOrBuilder { +private static final long serialVersionUID = 0L; + // Use Transaction.newBuilder() to construct. + private Transaction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Transaction() { + blockNumber_ = 0L; + blockHash_ = com.google.protobuf.ByteString.EMPTY; + index_ = 0; + hash_ = com.google.protobuf.ByteString.EMPTY; + type_ = 0; + from_ = com.google.protobuf.ByteString.EMPTY; + nonce_ = 0L; + to_ = com.google.protobuf.ByteString.EMPTY; + data_ = com.google.protobuf.ByteString.EMPTY; + v_ = com.google.protobuf.ByteString.EMPTY; + r_ = com.google.protobuf.ByteString.EMPTY; + s_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Transaction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + blockNumber_ = input.readUInt64(); + break; + } + case 18: { + + blockHash_ = input.readBytes(); + break; + } + case 24: { + + index_ = input.readUInt32(); + break; + } + case 34: { + + hash_ = input.readBytes(); + break; + } + case 40: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 50: { + + from_ = input.readBytes(); + break; + } + case 56: { + + nonce_ = input.readUInt64(); + break; + } + case 66: { + + to_ = input.readBytes(); + break; + } + case 74: { + + data_ = input.readBytes(); + break; + } + case 82: { + + v_ = input.readBytes(); + break; + } + case 90: { + + r_ = input.readBytes(); + break; + } + case 98: { + + s_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_Transaction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_Transaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.Transaction.class, bdchain.api.grpc.Transaction.Builder.class); + } + + public static final int BLOCK_NUMBER_FIELD_NUMBER = 1; + private long blockNumber_; + /** + *
+   * 事务所在的区块的区块号,当事务处于待确认状态时为`null`
+   * 
+ * + * uint64 block_number = 1; + */ + public long getBlockNumber() { + return blockNumber_; + } + + public static final int BLOCK_HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString blockHash_; + /** + *
+   * 事务所在的区块的哈希,当事务处于待确认状态时为`null`
+   * 
+ * + * bytes block_hash = 2; + */ + public com.google.protobuf.ByteString getBlockHash() { + return blockHash_; + } + + public static final int INDEX_FIELD_NUMBER = 3; + private int index_; + /** + *
+   * 事务在区块中的位置index,当事务处于待确认状态时为`null`
+   * 
+ * + * uint32 index = 3; + */ + public int getIndex() { + return index_; + } + + public static final int HASH_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString hash_; + /** + *
+   * 事务的哈希
+   * 
+ * + * bytes hash = 4; + */ + public com.google.protobuf.ByteString getHash() { + return hash_; + } + + public static final int TYPE_FIELD_NUMBER = 5; + private int type_; + /** + *
+   * 事务类型
+   * 
+ * + * .bdchain.api.TransactionType type = 5; + */ + public int getTypeValue() { + return type_; + } + /** + *
+   * 事务类型
+   * 
+ * + * .bdchain.api.TransactionType type = 5; + */ + public bdchain.api.grpc.TransactionType getType() { + @SuppressWarnings("deprecation") + bdchain.api.grpc.TransactionType result = bdchain.api.grpc.TransactionType.valueOf(type_); + return result == null ? bdchain.api.grpc.TransactionType.UNRECOGNIZED : result; + } + + public static final int FROM_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString from_; + /** + *
+   * 发送账户地址
+   * 
+ * + * bytes from = 6; + */ + public com.google.protobuf.ByteString getFrom() { + return from_; + } + + public static final int NONCE_FIELD_NUMBER = 7; + private long nonce_; + /** + *
+   * 这条事务之前发送者所发送的事务数量
+   * 
+ * + * uint64 nonce = 7; + */ + public long getNonce() { + return nonce_; + } + + public static final int TO_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString to_; + /** + *
+   * 接收账户地址,或者调用的合约地址,或者`null`如为合约创建
+   * 
+ * + * bytes to = 8; + */ + public com.google.protobuf.ByteString getTo() { + return to_; + } + + public static final int DATA_FIELD_NUMBER = 9; + private com.google.protobuf.ByteString data_; + /** + *
+   * 数据或合约代码
+   * 
+ * + * bytes data = 9; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int V_FIELD_NUMBER = 10; + private com.google.protobuf.ByteString v_; + /** + *
+   * ECDSA recovery id
+   * 
+ * + * bytes v = 10; + */ + public com.google.protobuf.ByteString getV() { + return v_; + } + + public static final int R_FIELD_NUMBER = 11; + private com.google.protobuf.ByteString r_; + /** + *
+   * ECDSA signature r
+   * 
+ * + * bytes r = 11; + */ + public com.google.protobuf.ByteString getR() { + return r_; + } + + public static final int S_FIELD_NUMBER = 12; + private com.google.protobuf.ByteString s_; + /** + *
+   * ECDSA signature s
+   * 
+ * + * bytes s = 12; + */ + public com.google.protobuf.ByteString getS() { + return s_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (blockNumber_ != 0L) { + output.writeUInt64(1, blockNumber_); + } + if (!blockHash_.isEmpty()) { + output.writeBytes(2, blockHash_); + } + if (index_ != 0) { + output.writeUInt32(3, index_); + } + if (!hash_.isEmpty()) { + output.writeBytes(4, hash_); + } + if (type_ != bdchain.api.grpc.TransactionType.RECORD.getNumber()) { + output.writeEnum(5, type_); + } + if (!from_.isEmpty()) { + output.writeBytes(6, from_); + } + if (nonce_ != 0L) { + output.writeUInt64(7, nonce_); + } + if (!to_.isEmpty()) { + output.writeBytes(8, to_); + } + if (!data_.isEmpty()) { + output.writeBytes(9, data_); + } + if (!v_.isEmpty()) { + output.writeBytes(10, v_); + } + if (!r_.isEmpty()) { + output.writeBytes(11, r_); + } + if (!s_.isEmpty()) { + output.writeBytes(12, s_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (blockNumber_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, blockNumber_); + } + if (!blockHash_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, blockHash_); + } + if (index_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, index_); + } + if (!hash_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, hash_); + } + if (type_ != bdchain.api.grpc.TransactionType.RECORD.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(5, type_); + } + if (!from_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, from_); + } + if (nonce_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(7, nonce_); + } + if (!to_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(8, to_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(9, data_); + } + if (!v_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(10, v_); + } + if (!r_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(11, r_); + } + if (!s_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(12, s_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof bdchain.api.grpc.Transaction)) { + return super.equals(obj); + } + bdchain.api.grpc.Transaction other = (bdchain.api.grpc.Transaction) obj; + + boolean result = true; + result = result && (getBlockNumber() + == other.getBlockNumber()); + result = result && getBlockHash() + .equals(other.getBlockHash()); + result = result && (getIndex() + == other.getIndex()); + result = result && getHash() + .equals(other.getHash()); + result = result && type_ == other.type_; + result = result && getFrom() + .equals(other.getFrom()); + result = result && (getNonce() + == other.getNonce()); + result = result && getTo() + .equals(other.getTo()); + result = result && getData() + .equals(other.getData()); + result = result && getV() + .equals(other.getV()); + result = result && getR() + .equals(other.getR()); + result = result && getS() + .equals(other.getS()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BLOCK_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBlockNumber()); + hash = (37 * hash) + BLOCK_HASH_FIELD_NUMBER; + hash = (53 * hash) + getBlockHash().hashCode(); + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + hash = (37 * hash) + HASH_FIELD_NUMBER; + hash = (53 * hash) + getHash().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + FROM_FIELD_NUMBER; + hash = (53 * hash) + getFrom().hashCode(); + hash = (37 * hash) + NONCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNonce()); + hash = (37 * hash) + TO_FIELD_NUMBER; + hash = (53 * hash) + getTo().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (37 * hash) + V_FIELD_NUMBER; + hash = (53 * hash) + getV().hashCode(); + hash = (37 * hash) + R_FIELD_NUMBER; + hash = (53 * hash) + getR().hashCode(); + hash = (37 * hash) + S_FIELD_NUMBER; + hash = (53 * hash) + getS().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static bdchain.api.grpc.Transaction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.Transaction parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.Transaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.Transaction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.Transaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static bdchain.api.grpc.Transaction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static bdchain.api.grpc.Transaction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.Transaction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.Transaction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static bdchain.api.grpc.Transaction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static bdchain.api.grpc.Transaction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static bdchain.api.grpc.Transaction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(bdchain.api.grpc.Transaction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code bdchain.api.Transaction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:bdchain.api.Transaction) + bdchain.api.grpc.TransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_Transaction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_Transaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + bdchain.api.grpc.Transaction.class, bdchain.api.grpc.Transaction.Builder.class); + } + + // Construct using bdchain.api.grpc.Transaction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + blockNumber_ = 0L; + + blockHash_ = com.google.protobuf.ByteString.EMPTY; + + index_ = 0; + + hash_ = com.google.protobuf.ByteString.EMPTY; + + type_ = 0; + + from_ = com.google.protobuf.ByteString.EMPTY; + + nonce_ = 0L; + + to_ = com.google.protobuf.ByteString.EMPTY; + + data_ = com.google.protobuf.ByteString.EMPTY; + + v_ = com.google.protobuf.ByteString.EMPTY; + + r_ = com.google.protobuf.ByteString.EMPTY; + + s_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return bdchain.api.grpc.AccountingChainProto.internal_static_bdchain_api_Transaction_descriptor; + } + + @java.lang.Override + public bdchain.api.grpc.Transaction getDefaultInstanceForType() { + return bdchain.api.grpc.Transaction.getDefaultInstance(); + } + + @java.lang.Override + public bdchain.api.grpc.Transaction build() { + bdchain.api.grpc.Transaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public bdchain.api.grpc.Transaction buildPartial() { + bdchain.api.grpc.Transaction result = new bdchain.api.grpc.Transaction(this); + result.blockNumber_ = blockNumber_; + result.blockHash_ = blockHash_; + result.index_ = index_; + result.hash_ = hash_; + result.type_ = type_; + result.from_ = from_; + result.nonce_ = nonce_; + result.to_ = to_; + result.data_ = data_; + result.v_ = v_; + result.r_ = r_; + result.s_ = s_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof bdchain.api.grpc.Transaction) { + return mergeFrom((bdchain.api.grpc.Transaction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(bdchain.api.grpc.Transaction other) { + if (other == bdchain.api.grpc.Transaction.getDefaultInstance()) return this; + if (other.getBlockNumber() != 0L) { + setBlockNumber(other.getBlockNumber()); + } + if (other.getBlockHash() != com.google.protobuf.ByteString.EMPTY) { + setBlockHash(other.getBlockHash()); + } + if (other.getIndex() != 0) { + setIndex(other.getIndex()); + } + if (other.getHash() != com.google.protobuf.ByteString.EMPTY) { + setHash(other.getHash()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.getFrom() != com.google.protobuf.ByteString.EMPTY) { + setFrom(other.getFrom()); + } + if (other.getNonce() != 0L) { + setNonce(other.getNonce()); + } + if (other.getTo() != com.google.protobuf.ByteString.EMPTY) { + setTo(other.getTo()); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + if (other.getV() != com.google.protobuf.ByteString.EMPTY) { + setV(other.getV()); + } + if (other.getR() != com.google.protobuf.ByteString.EMPTY) { + setR(other.getR()); + } + if (other.getS() != com.google.protobuf.ByteString.EMPTY) { + setS(other.getS()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + bdchain.api.grpc.Transaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (bdchain.api.grpc.Transaction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long blockNumber_ ; + /** + *
+     * 事务所在的区块的区块号,当事务处于待确认状态时为`null`
+     * 
+ * + * uint64 block_number = 1; + */ + public long getBlockNumber() { + return blockNumber_; + } + /** + *
+     * 事务所在的区块的区块号,当事务处于待确认状态时为`null`
+     * 
+ * + * uint64 block_number = 1; + */ + public Builder setBlockNumber(long value) { + + blockNumber_ = value; + onChanged(); + return this; + } + /** + *
+     * 事务所在的区块的区块号,当事务处于待确认状态时为`null`
+     * 
+ * + * uint64 block_number = 1; + */ + public Builder clearBlockNumber() { + + blockNumber_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString blockHash_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * 事务所在的区块的哈希,当事务处于待确认状态时为`null`
+     * 
+ * + * bytes block_hash = 2; + */ + public com.google.protobuf.ByteString getBlockHash() { + return blockHash_; + } + /** + *
+     * 事务所在的区块的哈希,当事务处于待确认状态时为`null`
+     * 
+ * + * bytes block_hash = 2; + */ + public Builder setBlockHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + blockHash_ = value; + onChanged(); + return this; + } + /** + *
+     * 事务所在的区块的哈希,当事务处于待确认状态时为`null`
+     * 
+ * + * bytes block_hash = 2; + */ + public Builder clearBlockHash() { + + blockHash_ = getDefaultInstance().getBlockHash(); + onChanged(); + return this; + } + + private int index_ ; + /** + *
+     * 事务在区块中的位置index,当事务处于待确认状态时为`null`
+     * 
+ * + * uint32 index = 3; + */ + public int getIndex() { + return index_; + } + /** + *
+     * 事务在区块中的位置index,当事务处于待确认状态时为`null`
+     * 
+ * + * uint32 index = 3; + */ + public Builder setIndex(int value) { + + index_ = value; + onChanged(); + return this; + } + /** + *
+     * 事务在区块中的位置index,当事务处于待确认状态时为`null`
+     * 
+ * + * uint32 index = 3; + */ + public Builder clearIndex() { + + index_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * 事务的哈希
+     * 
+ * + * bytes hash = 4; + */ + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + *
+     * 事务的哈希
+     * 
+ * + * bytes hash = 4; + */ + public Builder setHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + hash_ = value; + onChanged(); + return this; + } + /** + *
+     * 事务的哈希
+     * 
+ * + * bytes hash = 4; + */ + public Builder clearHash() { + + hash_ = getDefaultInstance().getHash(); + onChanged(); + return this; + } + + private int type_ = 0; + /** + *
+     * 事务类型
+     * 
+ * + * .bdchain.api.TransactionType type = 5; + */ + public int getTypeValue() { + return type_; + } + /** + *
+     * 事务类型
+     * 
+ * + * .bdchain.api.TransactionType type = 5; + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + *
+     * 事务类型
+     * 
+ * + * .bdchain.api.TransactionType type = 5; + */ + public bdchain.api.grpc.TransactionType getType() { + @SuppressWarnings("deprecation") + bdchain.api.grpc.TransactionType result = bdchain.api.grpc.TransactionType.valueOf(type_); + return result == null ? bdchain.api.grpc.TransactionType.UNRECOGNIZED : result; + } + /** + *
+     * 事务类型
+     * 
+ * + * .bdchain.api.TransactionType type = 5; + */ + public Builder setType(bdchain.api.grpc.TransactionType value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * 事务类型
+     * 
+ * + * .bdchain.api.TransactionType type = 5; + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString from_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * 发送账户地址
+     * 
+ * + * bytes from = 6; + */ + public com.google.protobuf.ByteString getFrom() { + return from_; + } + /** + *
+     * 发送账户地址
+     * 
+ * + * bytes from = 6; + */ + public Builder setFrom(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + from_ = value; + onChanged(); + return this; + } + /** + *
+     * 发送账户地址
+     * 
+ * + * bytes from = 6; + */ + public Builder clearFrom() { + + from_ = getDefaultInstance().getFrom(); + onChanged(); + return this; + } + + private long nonce_ ; + /** + *
+     * 这条事务之前发送者所发送的事务数量
+     * 
+ * + * uint64 nonce = 7; + */ + public long getNonce() { + return nonce_; + } + /** + *
+     * 这条事务之前发送者所发送的事务数量
+     * 
+ * + * uint64 nonce = 7; + */ + public Builder setNonce(long value) { + + nonce_ = value; + onChanged(); + return this; + } + /** + *
+     * 这条事务之前发送者所发送的事务数量
+     * 
+ * + * uint64 nonce = 7; + */ + public Builder clearNonce() { + + nonce_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString to_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * 接收账户地址,或者调用的合约地址,或者`null`如为合约创建
+     * 
+ * + * bytes to = 8; + */ + public com.google.protobuf.ByteString getTo() { + return to_; + } + /** + *
+     * 接收账户地址,或者调用的合约地址,或者`null`如为合约创建
+     * 
+ * + * bytes to = 8; + */ + public Builder setTo(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + to_ = value; + onChanged(); + return this; + } + /** + *
+     * 接收账户地址,或者调用的合约地址,或者`null`如为合约创建
+     * 
+ * + * bytes to = 8; + */ + public Builder clearTo() { + + to_ = getDefaultInstance().getTo(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * 数据或合约代码
+     * 
+ * + * bytes data = 9; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+     * 数据或合约代码
+     * 
+ * + * bytes data = 9; + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
+     * 数据或合约代码
+     * 
+ * + * bytes data = 9; + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString v_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * ECDSA recovery id
+     * 
+ * + * bytes v = 10; + */ + public com.google.protobuf.ByteString getV() { + return v_; + } + /** + *
+     * ECDSA recovery id
+     * 
+ * + * bytes v = 10; + */ + public Builder setV(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + v_ = value; + onChanged(); + return this; + } + /** + *
+     * ECDSA recovery id
+     * 
+ * + * bytes v = 10; + */ + public Builder clearV() { + + v_ = getDefaultInstance().getV(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString r_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * ECDSA signature r
+     * 
+ * + * bytes r = 11; + */ + public com.google.protobuf.ByteString getR() { + return r_; + } + /** + *
+     * ECDSA signature r
+     * 
+ * + * bytes r = 11; + */ + public Builder setR(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + r_ = value; + onChanged(); + return this; + } + /** + *
+     * ECDSA signature r
+     * 
+ * + * bytes r = 11; + */ + public Builder clearR() { + + r_ = getDefaultInstance().getR(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString s_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * ECDSA signature s
+     * 
+ * + * bytes s = 12; + */ + public com.google.protobuf.ByteString getS() { + return s_; + } + /** + *
+     * ECDSA signature s
+     * 
+ * + * bytes s = 12; + */ + public Builder setS(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + s_ = value; + onChanged(); + return this; + } + /** + *
+     * ECDSA signature s
+     * 
+ * + * bytes s = 12; + */ + public Builder clearS() { + + s_ = getDefaultInstance().getS(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:bdchain.api.Transaction) + } + + // @@protoc_insertion_point(class_scope:bdchain.api.Transaction) + private static final bdchain.api.grpc.Transaction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new bdchain.api.grpc.Transaction(); + } + + public static bdchain.api.grpc.Transaction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Transaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Transaction(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public bdchain.api.grpc.Transaction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/bdchain/api/grpc/TransactionLedgerGrpc.java b/src/main/java/bdchain/api/grpc/TransactionLedgerGrpc.java new file mode 100644 index 0000000..646a42d --- /dev/null +++ b/src/main/java/bdchain/api/grpc/TransactionLedgerGrpc.java @@ -0,0 +1,430 @@ +package bdchain.api.grpc; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.14.0)", + comments = "Source: bdchain/api/tx_ledger.proto") +public final class TransactionLedgerGrpc { + + private TransactionLedgerGrpc() {} + + public static final String SERVICE_NAME = "bdchain.api.TransactionLedger"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getCreateLedgerMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateLedger", + requestType = bdchain.api.grpc.CreateLedgerRequest.class, + responseType = bdchain.api.grpc.CreateLedgerResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateLedgerMethod() { + io.grpc.MethodDescriptor getCreateLedgerMethod; + if ((getCreateLedgerMethod = TransactionLedgerGrpc.getCreateLedgerMethod) == null) { + synchronized (TransactionLedgerGrpc.class) { + if ((getCreateLedgerMethod = TransactionLedgerGrpc.getCreateLedgerMethod) == null) { + TransactionLedgerGrpc.getCreateLedgerMethod = getCreateLedgerMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "bdchain.api.TransactionLedger", "CreateLedger")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.CreateLedgerRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.CreateLedgerResponse.getDefaultInstance())) + .setSchemaDescriptor(new TransactionLedgerMethodDescriptorSupplier("CreateLedger")) + .build(); + } + } + } + return getCreateLedgerMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetLedgersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetLedgers", + requestType = com.google.protobuf.Empty.class, + responseType = bdchain.api.grpc.GetLedgersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetLedgersMethod() { + io.grpc.MethodDescriptor getGetLedgersMethod; + if ((getGetLedgersMethod = TransactionLedgerGrpc.getGetLedgersMethod) == null) { + synchronized (TransactionLedgerGrpc.class) { + if ((getGetLedgersMethod = TransactionLedgerGrpc.getGetLedgersMethod) == null) { + TransactionLedgerGrpc.getGetLedgersMethod = getGetLedgersMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "bdchain.api.TransactionLedger", "GetLedgers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.GetLedgersResponse.getDefaultInstance())) + .setSchemaDescriptor(new TransactionLedgerMethodDescriptorSupplier("GetLedgers")) + .build(); + } + } + } + return getGetLedgersMethod; + } + + private static volatile io.grpc.MethodDescriptor getSendTransactionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SendTransaction", + requestType = bdchain.api.grpc.SendTransactionRequest.class, + responseType = bdchain.api.grpc.SendTransactionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSendTransactionMethod() { + io.grpc.MethodDescriptor getSendTransactionMethod; + if ((getSendTransactionMethod = TransactionLedgerGrpc.getSendTransactionMethod) == null) { + synchronized (TransactionLedgerGrpc.class) { + if ((getSendTransactionMethod = TransactionLedgerGrpc.getSendTransactionMethod) == null) { + TransactionLedgerGrpc.getSendTransactionMethod = getSendTransactionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "bdchain.api.TransactionLedger", "SendTransaction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.SendTransactionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + bdchain.api.grpc.SendTransactionResponse.getDefaultInstance())) + .setSchemaDescriptor(new TransactionLedgerMethodDescriptorSupplier("SendTransaction")) + .build(); + } + } + } + return getSendTransactionMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static TransactionLedgerStub newStub(io.grpc.Channel channel) { + return new TransactionLedgerStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TransactionLedgerBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new TransactionLedgerBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static TransactionLedgerFutureStub newFutureStub( + io.grpc.Channel channel) { + return new TransactionLedgerFutureStub(channel); + } + + /** + */ + public static abstract class TransactionLedgerImplBase implements io.grpc.BindableService { + + /** + */ + public void createLedger(bdchain.api.grpc.CreateLedgerRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateLedgerMethod(), responseObserver); + } + + /** + */ + public void getLedgers(com.google.protobuf.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetLedgersMethod(), responseObserver); + } + + /** + */ + public void sendTransaction(bdchain.api.grpc.SendTransactionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSendTransactionMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateLedgerMethod(), + asyncUnaryCall( + new MethodHandlers< + bdchain.api.grpc.CreateLedgerRequest, + bdchain.api.grpc.CreateLedgerResponse>( + this, METHODID_CREATE_LEDGER))) + .addMethod( + getGetLedgersMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.protobuf.Empty, + bdchain.api.grpc.GetLedgersResponse>( + this, METHODID_GET_LEDGERS))) + .addMethod( + getSendTransactionMethod(), + asyncUnaryCall( + new MethodHandlers< + bdchain.api.grpc.SendTransactionRequest, + bdchain.api.grpc.SendTransactionResponse>( + this, METHODID_SEND_TRANSACTION))) + .build(); + } + } + + /** + */ + public static final class TransactionLedgerStub extends io.grpc.stub.AbstractStub { + private TransactionLedgerStub(io.grpc.Channel channel) { + super(channel); + } + + private TransactionLedgerStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TransactionLedgerStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new TransactionLedgerStub(channel, callOptions); + } + + /** + */ + public void createLedger(bdchain.api.grpc.CreateLedgerRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateLedgerMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getLedgers(com.google.protobuf.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetLedgersMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void sendTransaction(bdchain.api.grpc.SendTransactionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSendTransactionMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class TransactionLedgerBlockingStub extends io.grpc.stub.AbstractStub { + private TransactionLedgerBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private TransactionLedgerBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TransactionLedgerBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new TransactionLedgerBlockingStub(channel, callOptions); + } + + /** + */ + public bdchain.api.grpc.CreateLedgerResponse createLedger(bdchain.api.grpc.CreateLedgerRequest request) { + return blockingUnaryCall( + getChannel(), getCreateLedgerMethod(), getCallOptions(), request); + } + + /** + */ + public bdchain.api.grpc.GetLedgersResponse getLedgers(com.google.protobuf.Empty request) { + return blockingUnaryCall( + getChannel(), getGetLedgersMethod(), getCallOptions(), request); + } + + /** + */ + public bdchain.api.grpc.SendTransactionResponse sendTransaction(bdchain.api.grpc.SendTransactionRequest request) { + return blockingUnaryCall( + getChannel(), getSendTransactionMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class TransactionLedgerFutureStub extends io.grpc.stub.AbstractStub { + private TransactionLedgerFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private TransactionLedgerFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TransactionLedgerFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new TransactionLedgerFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createLedger( + bdchain.api.grpc.CreateLedgerRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateLedgerMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getLedgers( + com.google.protobuf.Empty request) { + return futureUnaryCall( + getChannel().newCall(getGetLedgersMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture sendTransaction( + bdchain.api.grpc.SendTransactionRequest request) { + return futureUnaryCall( + getChannel().newCall(getSendTransactionMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_LEDGER = 0; + private static final int METHODID_GET_LEDGERS = 1; + private static final int METHODID_SEND_TRANSACTION = 2; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final TransactionLedgerImplBase serviceImpl; + private final int methodId; + + MethodHandlers(TransactionLedgerImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_LEDGER: + serviceImpl.createLedger((bdchain.api.grpc.CreateLedgerRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_LEDGERS: + serviceImpl.getLedgers((com.google.protobuf.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SEND_TRANSACTION: + serviceImpl.sendTransaction((bdchain.api.grpc.SendTransactionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class TransactionLedgerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TransactionLedgerBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return bdchain.api.grpc.TransactionLedgerProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("TransactionLedger"); + } + } + + private static final class TransactionLedgerFileDescriptorSupplier + extends TransactionLedgerBaseDescriptorSupplier { + TransactionLedgerFileDescriptorSupplier() {} + } + + private static final class TransactionLedgerMethodDescriptorSupplier + extends TransactionLedgerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + TransactionLedgerMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (TransactionLedgerGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TransactionLedgerFileDescriptorSupplier()) + .addMethod(getCreateLedgerMethod()) + .addMethod(getGetLedgersMethod()) + .addMethod(getSendTransactionMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/main/java/bdchain/api/grpc/TransactionLedgerProto.java b/src/main/java/bdchain/api/grpc/TransactionLedgerProto.java new file mode 100644 index 0000000..fe19ff8 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/TransactionLedgerProto.java @@ -0,0 +1,133 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/tx_ledger.proto + +package bdchain.api.grpc; + +public final class TransactionLedgerProto { + private TransactionLedgerProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_CreateLedgerRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_CreateLedgerRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_CreateLedgerResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_CreateLedgerResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_GetLedgersResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_GetLedgersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_SendTransactionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_SendTransactionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_SendTransactionRequest_Transaction_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_SendTransactionRequest_Transaction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_bdchain_api_SendTransactionResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_bdchain_api_SendTransactionResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\033bdchain/api/tx_ledger.proto\022\013bdchain.a" + + "pi\032\033google/protobuf/empty.proto\032\030bdchain" + + "/api/common.proto\"#\n\023CreateLedgerRequest" + + "\022\014\n\004name\030\001 \001(\t\"\"\n\024CreateLedgerResponse\022\n" + + "\n\002ok\030\001 \001(\010\"%\n\022GetLedgersResponse\022\017\n\007ledg" + + "ers\030\001 \003(\t\"\321\001\n\026SendTransactionRequest\022\016\n\006" + + "ledger\030\001 \001(\t\022D\n\013transaction\030\002 \001(\0132/.bdch" + + "ain.api.SendTransactionRequest.Transacti" + + "on\032a\n\013Transaction\022*\n\004type\030\001 \001(\0162\034.bdchai" + + "n.api.TransactionType\022\014\n\004from\030\002 \001(\014\022\n\n\002t" + + "o\030\003 \001(\014\022\014\n\004data\030\004 \001(\014\"\'\n\027SendTransaction" + + "Response\022\014\n\004hash\030\001 \001(\0142\215\002\n\021TransactionLe" + + "dger\022S\n\014CreateLedger\022 .bdchain.api.Creat" + + "eLedgerRequest\032!.bdchain.api.CreateLedge" + + "rResponse\022E\n\nGetLedgers\022\026.google.protobu" + + "f.Empty\032\037.bdchain.api.GetLedgersResponse" + + "\022\\\n\017SendTransaction\022#.bdchain.api.SendTr" + + "ansactionRequest\032$.bdchain.api.SendTrans" + + "actionResponseBC\n\020bdchain.api.grpcB\026Tran" + + "sactionLedgerProtoP\001Z\025bdchain/api/tx_led" + + "gerb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.EmptyProto.getDescriptor(), + bdchain.api.grpc.CommonProto.getDescriptor(), + }, assigner); + internal_static_bdchain_api_CreateLedgerRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_bdchain_api_CreateLedgerRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_CreateLedgerRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_bdchain_api_CreateLedgerResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_bdchain_api_CreateLedgerResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_CreateLedgerResponse_descriptor, + new java.lang.String[] { "Ok", }); + internal_static_bdchain_api_GetLedgersResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_bdchain_api_GetLedgersResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_GetLedgersResponse_descriptor, + new java.lang.String[] { "Ledgers", }); + internal_static_bdchain_api_SendTransactionRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_bdchain_api_SendTransactionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_SendTransactionRequest_descriptor, + new java.lang.String[] { "Ledger", "Transaction", }); + internal_static_bdchain_api_SendTransactionRequest_Transaction_descriptor = + internal_static_bdchain_api_SendTransactionRequest_descriptor.getNestedTypes().get(0); + internal_static_bdchain_api_SendTransactionRequest_Transaction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_SendTransactionRequest_Transaction_descriptor, + new java.lang.String[] { "Type", "From", "To", "Data", }); + internal_static_bdchain_api_SendTransactionResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_bdchain_api_SendTransactionResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_bdchain_api_SendTransactionResponse_descriptor, + new java.lang.String[] { "Hash", }); + com.google.protobuf.EmptyProto.getDescriptor(); + bdchain.api.grpc.CommonProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/bdchain/api/grpc/TransactionOrBuilder.java b/src/main/java/bdchain/api/grpc/TransactionOrBuilder.java new file mode 100644 index 0000000..2c2d7b2 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/TransactionOrBuilder.java @@ -0,0 +1,125 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/ac_chain.proto + +package bdchain.api.grpc; + +public interface TransactionOrBuilder extends + // @@protoc_insertion_point(interface_extends:bdchain.api.Transaction) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * 事务所在的区块的区块号,当事务处于待确认状态时为`null`
+   * 
+ * + * uint64 block_number = 1; + */ + long getBlockNumber(); + + /** + *
+   * 事务所在的区块的哈希,当事务处于待确认状态时为`null`
+   * 
+ * + * bytes block_hash = 2; + */ + com.google.protobuf.ByteString getBlockHash(); + + /** + *
+   * 事务在区块中的位置index,当事务处于待确认状态时为`null`
+   * 
+ * + * uint32 index = 3; + */ + int getIndex(); + + /** + *
+   * 事务的哈希
+   * 
+ * + * bytes hash = 4; + */ + com.google.protobuf.ByteString getHash(); + + /** + *
+   * 事务类型
+   * 
+ * + * .bdchain.api.TransactionType type = 5; + */ + int getTypeValue(); + /** + *
+   * 事务类型
+   * 
+ * + * .bdchain.api.TransactionType type = 5; + */ + bdchain.api.grpc.TransactionType getType(); + + /** + *
+   * 发送账户地址
+   * 
+ * + * bytes from = 6; + */ + com.google.protobuf.ByteString getFrom(); + + /** + *
+   * 这条事务之前发送者所发送的事务数量
+   * 
+ * + * uint64 nonce = 7; + */ + long getNonce(); + + /** + *
+   * 接收账户地址,或者调用的合约地址,或者`null`如为合约创建
+   * 
+ * + * bytes to = 8; + */ + com.google.protobuf.ByteString getTo(); + + /** + *
+   * 数据或合约代码
+   * 
+ * + * bytes data = 9; + */ + com.google.protobuf.ByteString getData(); + + /** + *
+   * ECDSA recovery id
+   * 
+ * + * bytes v = 10; + */ + com.google.protobuf.ByteString getV(); + + /** + *
+   * ECDSA signature r
+   * 
+ * + * bytes r = 11; + */ + com.google.protobuf.ByteString getR(); + + /** + *
+   * ECDSA signature s
+   * 
+ * + * bytes s = 12; + */ + com.google.protobuf.ByteString getS(); +} diff --git a/src/main/java/bdchain/api/grpc/TransactionType.java b/src/main/java/bdchain/api/grpc/TransactionType.java new file mode 100644 index 0000000..e69f4b2 --- /dev/null +++ b/src/main/java/bdchain/api/grpc/TransactionType.java @@ -0,0 +1,157 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bdchain/api/common.proto + +package bdchain.api.grpc; + +/** + *
+ * 事务类型 
+ * 
+ * + * Protobuf enum {@code bdchain.api.TransactionType} + */ +public enum TransactionType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * 通用数据记录
+   * 
+ * + * RECORD = 0; + */ + RECORD(0), + /** + *
+   * 消息
+   * 
+ * + * MESSAGE = 1; + */ + MESSAGE(1), + /** + *
+   * 合约创建
+   * 
+ * + * CONTRACT_CREATION = 2; + */ + CONTRACT_CREATION(2), + /** + *
+   * 合约调用
+   * 
+ * + * CONTRACT_INVOCATION = 3; + */ + CONTRACT_INVOCATION(3), + UNRECOGNIZED(-1), + ; + + /** + *
+   * 通用数据记录
+   * 
+ * + * RECORD = 0; + */ + public static final int RECORD_VALUE = 0; + /** + *
+   * 消息
+   * 
+ * + * MESSAGE = 1; + */ + public static final int MESSAGE_VALUE = 1; + /** + *
+   * 合约创建
+   * 
+ * + * CONTRACT_CREATION = 2; + */ + public static final int CONTRACT_CREATION_VALUE = 2; + /** + *
+   * 合约调用
+   * 
+ * + * CONTRACT_INVOCATION = 3; + */ + public static final int CONTRACT_INVOCATION_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TransactionType valueOf(int value) { + return forNumber(value); + } + + public static TransactionType forNumber(int value) { + switch (value) { + case 0: return RECORD; + case 1: return MESSAGE; + case 2: return CONTRACT_CREATION; + case 3: return CONTRACT_INVOCATION; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + TransactionType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TransactionType findValueByNumber(int number) { + return TransactionType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return bdchain.api.grpc.CommonProto.getDescriptor().getEnumTypes().get(0); + } + + private static final TransactionType[] VALUES = values(); + + public static TransactionType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private TransactionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:bdchain.api.TransactionType) +} + diff --git a/src/main/java/com/google/protobuf/Empty.java b/src/main/java/com/google/protobuf/Empty.java new file mode 100644 index 0000000..0f9ee77 --- /dev/null +++ b/src/main/java/com/google/protobuf/Empty.java @@ -0,0 +1,433 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/empty.proto + +package com.google.protobuf; + +/** + *
+ * A generic empty message that you can re-use to avoid defining duplicated
+ * empty messages in your APIs. A typical example is to use it as the request
+ * or the response type of an API method. For instance:
+ *     service Foo {
+ *       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
+ *     }
+ * The JSON representation for `Empty` is empty JSON object `{}`.
+ * 
+ * + * Protobuf type {@code google.protobuf.Empty} + */ +public final class Empty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.protobuf.Empty) + EmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Empty.newBuilder() to construct. + private Empty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Empty() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Empty( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.protobuf.EmptyProto.internal_static_google_protobuf_Empty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.protobuf.EmptyProto.internal_static_google_protobuf_Empty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.protobuf.Empty.class, com.google.protobuf.Empty.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.protobuf.Empty)) { + return super.equals(obj); + } + com.google.protobuf.Empty other = (com.google.protobuf.Empty) obj; + + boolean result = true; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.protobuf.Empty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.protobuf.Empty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.protobuf.Empty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.protobuf.Empty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.protobuf.Empty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.protobuf.Empty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.protobuf.Empty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.protobuf.Empty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.protobuf.Empty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.protobuf.Empty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.protobuf.Empty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.protobuf.Empty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.protobuf.Empty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A generic empty message that you can re-use to avoid defining duplicated
+   * empty messages in your APIs. A typical example is to use it as the request
+   * or the response type of an API method. For instance:
+   *     service Foo {
+   *       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
+   *     }
+   * The JSON representation for `Empty` is empty JSON object `{}`.
+   * 
+ * + * Protobuf type {@code google.protobuf.Empty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.protobuf.Empty) + com.google.protobuf.EmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.protobuf.EmptyProto.internal_static_google_protobuf_Empty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.protobuf.EmptyProto.internal_static_google_protobuf_Empty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.protobuf.Empty.class, com.google.protobuf.Empty.Builder.class); + } + + // Construct using com.google.protobuf.Empty.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.protobuf.EmptyProto.internal_static_google_protobuf_Empty_descriptor; + } + + @java.lang.Override + public com.google.protobuf.Empty getDefaultInstanceForType() { + return com.google.protobuf.Empty.getDefaultInstance(); + } + + @java.lang.Override + public com.google.protobuf.Empty build() { + com.google.protobuf.Empty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.protobuf.Empty buildPartial() { + com.google.protobuf.Empty result = new com.google.protobuf.Empty(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.protobuf.Empty) { + return mergeFrom((com.google.protobuf.Empty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.protobuf.Empty other) { + if (other == com.google.protobuf.Empty.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.protobuf.Empty parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.protobuf.Empty) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.protobuf.Empty) + } + + // @@protoc_insertion_point(class_scope:google.protobuf.Empty) + private static final com.google.protobuf.Empty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.protobuf.Empty(); + } + + public static com.google.protobuf.Empty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Empty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Empty(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Empty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/protobuf/EmptyOrBuilder.java b/src/main/java/com/google/protobuf/EmptyOrBuilder.java new file mode 100644 index 0000000..9a38161 --- /dev/null +++ b/src/main/java/com/google/protobuf/EmptyOrBuilder.java @@ -0,0 +1,9 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/empty.proto + +package com.google.protobuf; + +public interface EmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.protobuf.Empty) + com.google.protobuf.MessageOrBuilder { +} diff --git a/src/main/java/com/google/protobuf/EmptyProto.java b/src/main/java/com/google/protobuf/EmptyProto.java new file mode 100644 index 0000000..7e298d5 --- /dev/null +++ b/src/main/java/com/google/protobuf/EmptyProto.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/empty.proto + +package com.google.protobuf; + +public final class EmptyProto { + private EmptyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_protobuf_Empty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_protobuf_Empty_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\033google/protobuf/empty.proto\022\017google.pr" + + "otobuf\"\007\n\005EmptyBv\n\023com.google.protobufB\n" + + "EmptyProtoP\001Z\'github.com/golang/protobuf" + + "/ptypes/empty\370\001\001\242\002\003GPB\252\002\036Google.Protobuf" + + ".WellKnownTypesb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_google_protobuf_Empty_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_protobuf_Empty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_protobuf_Empty_descriptor, + new java.lang.String[] { }); + } + + // @@protoc_insertion_point(outer_class_scope) +}