diff --git a/src/androidTest/java/cash/z/wallet/sdk/data/SynchronizerTest.kt b/src/androidTest/java/cash/z/wallet/sdk/data/SynchronizerTest.kt index c57c2a06..49f88f52 100644 --- a/src/androidTest/java/cash/z/wallet/sdk/data/SynchronizerTest.kt +++ b/src/androidTest/java/cash/z/wallet/sdk/data/SynchronizerTest.kt @@ -11,7 +11,7 @@ import org.junit.Assert.assertNotNull import org.junit.BeforeClass import org.junit.Rule import org.junit.Test -import rpc.CompactFormats +import cash.z.wallet.sdk.rpc.CompactFormats class SynchronizerTest { @get:Rule diff --git a/src/androidTest/java/cash/z/wallet/sdk/db/GlueIntegrationTest.kt b/src/androidTest/java/cash/z/wallet/sdk/db/GlueIntegrationTest.kt index e708af86..6714c4a9 100644 --- a/src/androidTest/java/cash/z/wallet/sdk/db/GlueIntegrationTest.kt +++ b/src/androidTest/java/cash/z/wallet/sdk/db/GlueIntegrationTest.kt @@ -16,9 +16,9 @@ import io.grpc.ManagedChannel import io.grpc.ManagedChannelBuilder import org.junit.* import org.junit.Assert.* -import rpc.CompactTxStreamerGrpc -import rpc.Service -import rpc.Service.* +import cash.z.wallet.sdk.rpc.CompactTxStreamerGrpc +import cash.z.wallet.sdk.rpc.Service +import cash.z.wallet.sdk.rpc.Service.* import java.util.concurrent.TimeUnit class GlueIntegrationTest { @@ -49,15 +49,17 @@ class GlueIntegrationTest { while (result.hasNext()) { val compactBlock = result.next() dao.insert(CompactBlock(compactBlock.height.toInt(), compactBlock.toByteArray())) - System.err.println("stored block at height: ${compactBlock.height}") + System.err.println("stored block at height: ${compactBlock.height} with time ${compactBlock.time}") } } private fun scanData() { + val dbFileName = "/data/user/0/cash.z.wallet.sdk.test/databases/new-data-glue.db" + converter.initDataDb(dbFileName) Log.e("tezt", "scanning blocks...") val result = converter.scanBlocks( cacheDbPath, - "/data/user/0/cash.z.wallet.sdk.test/databases/data-glue.db", + dbFileName, "dummyseed".toByteArray(), 373070 ) @@ -75,7 +77,7 @@ class GlueIntegrationTest { // db private lateinit var dao: CompactBlockDao private lateinit var db: CompactBlockDb - private const val cacheDbName = "dummy-cache-glue.db" + private const val cacheDbName = "new-dummy-cache-glue.db" private const val cacheDbPath = "/data/user/0/cash.z.wallet.sdk.test/databases/$cacheDbName" // grpc diff --git a/src/androidTest/java/cash/z/wallet/sdk/db/GlueSetupIntegrationTest.kt b/src/androidTest/java/cash/z/wallet/sdk/db/GlueSetupIntegrationTest.kt index 972a83cb..533ea7e7 100644 --- a/src/androidTest/java/cash/z/wallet/sdk/db/GlueSetupIntegrationTest.kt +++ b/src/androidTest/java/cash/z/wallet/sdk/db/GlueSetupIntegrationTest.kt @@ -16,9 +16,9 @@ import io.grpc.ManagedChannel import io.grpc.ManagedChannelBuilder import org.junit.* import org.junit.Assert.* -import rpc.CompactTxStreamerGrpc -import rpc.Service -import rpc.Service.* +import cash.z.wallet.sdk.rpc.CompactTxStreamerGrpc +import cash.z.wallet.sdk.rpc.Service +import cash.z.wallet.sdk.rpc.Service.* import java.util.concurrent.TimeUnit class GlueSetupIntegrationTest { diff --git a/src/androidTest/java/cash/z/wallet/sdk/jni/JniConverterTest.kt b/src/androidTest/java/cash/z/wallet/sdk/jni/JniConverterTest.kt index d338b4d1..94051d59 100644 --- a/src/androidTest/java/cash/z/wallet/sdk/jni/JniConverterTest.kt +++ b/src/androidTest/java/cash/z/wallet/sdk/jni/JniConverterTest.kt @@ -22,15 +22,28 @@ class JniConverterTest { @Test fun testScanBlocks() { + converter.initDataDb("/data/user/0/cash.z.wallet.sdk.test/databases/data2.db") // note: for this to work, the db file below must be uploaded to the device. Eventually, this test will be self-contained and remove that requirement. val result = converter.scanBlocks( "/data/user/0/cash.z.wallet.sdk.test/databases/dummy-cache.db", - "/data/user/0/cash.z.wallet.sdk.test/databases/data.db", + "/data/user/0/cash.z.wallet.sdk.test/databases/data2.db", "dummyseed".toByteArray(), 343900 ) // Thread.sleep(15 * DateUtils.MINUTE_IN_MILLIS) - assertEquals("Invalid number of results", 2, 3) + assertEquals("Invalid number of results", 3, 3) + } + + @Test + fun testSend() { + converter.sendToAddress( + "/data/user/0/cash.z.wallet.sdk.test/databases/data2.db", + "dummyseed".toByteArray(), + "ztestsapling1fg82ar8y8whjfd52l0xcq0w3n7nn7cask2scp9rp27njeurr72ychvud57s9tu90fdqgwdt07lg", + 210_000, + "/data/user/0/cash.z.wallet.sdk.test/databases/sapling-spend.params", + "/data/user/0/cash.z.wallet.sdk.test/databases/sapling-output.params" + ) } companion object { diff --git a/src/generated/source/grpc/debug/grpc/rpc/CompactTxStreamerGrpc.java b/src/generated/source/grpc/debug/grpc/rpc/CompactTxStreamerGrpc.java deleted file mode 100644 index 456fe026..00000000 --- a/src/generated/source/grpc/debug/grpc/rpc/CompactTxStreamerGrpc.java +++ /dev/null @@ -1,532 +0,0 @@ -package rpc; - -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.17.1)", - comments = "Source: service.proto") -public final class CompactTxStreamerGrpc { - - private CompactTxStreamerGrpc() {} - - public static final String SERVICE_NAME = "rpc.CompactTxStreamer"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getGetLatestBlockMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetLatestBlock", - requestType = rpc.Service.ChainSpec.class, - responseType = rpc.Service.BlockID.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetLatestBlockMethod() { - io.grpc.MethodDescriptor getGetLatestBlockMethod; - if ((getGetLatestBlockMethod = CompactTxStreamerGrpc.getGetLatestBlockMethod) == null) { - synchronized (CompactTxStreamerGrpc.class) { - if ((getGetLatestBlockMethod = CompactTxStreamerGrpc.getGetLatestBlockMethod) == null) { - CompactTxStreamerGrpc.getGetLatestBlockMethod = getGetLatestBlockMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "rpc.CompactTxStreamer", "GetLatestBlock")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - rpc.Service.ChainSpec.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - rpc.Service.BlockID.getDefaultInstance())) - .build(); - } - } - } - return getGetLatestBlockMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetBlockMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetBlock", - requestType = rpc.Service.BlockID.class, - responseType = rpc.CompactFormats.CompactBlock.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetBlockMethod() { - io.grpc.MethodDescriptor getGetBlockMethod; - if ((getGetBlockMethod = CompactTxStreamerGrpc.getGetBlockMethod) == null) { - synchronized (CompactTxStreamerGrpc.class) { - if ((getGetBlockMethod = CompactTxStreamerGrpc.getGetBlockMethod) == null) { - CompactTxStreamerGrpc.getGetBlockMethod = getGetBlockMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "rpc.CompactTxStreamer", "GetBlock")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - rpc.Service.BlockID.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - rpc.CompactFormats.CompactBlock.getDefaultInstance())) - .build(); - } - } - } - return getGetBlockMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetBlockRangeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetBlockRange", - requestType = rpc.Service.BlockRange.class, - responseType = rpc.CompactFormats.CompactBlock.class, - methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - public static io.grpc.MethodDescriptor getGetBlockRangeMethod() { - io.grpc.MethodDescriptor getGetBlockRangeMethod; - if ((getGetBlockRangeMethod = CompactTxStreamerGrpc.getGetBlockRangeMethod) == null) { - synchronized (CompactTxStreamerGrpc.class) { - if ((getGetBlockRangeMethod = CompactTxStreamerGrpc.getGetBlockRangeMethod) == null) { - CompactTxStreamerGrpc.getGetBlockRangeMethod = getGetBlockRangeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName(generateFullMethodName( - "rpc.CompactTxStreamer", "GetBlockRange")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - rpc.Service.BlockRange.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - rpc.CompactFormats.CompactBlock.getDefaultInstance())) - .build(); - } - } - } - return getGetBlockRangeMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetTransactionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetTransaction", - requestType = rpc.Service.TxFilter.class, - responseType = rpc.Service.RawTransaction.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetTransactionMethod() { - io.grpc.MethodDescriptor getGetTransactionMethod; - if ((getGetTransactionMethod = CompactTxStreamerGrpc.getGetTransactionMethod) == null) { - synchronized (CompactTxStreamerGrpc.class) { - if ((getGetTransactionMethod = CompactTxStreamerGrpc.getGetTransactionMethod) == null) { - CompactTxStreamerGrpc.getGetTransactionMethod = getGetTransactionMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "rpc.CompactTxStreamer", "GetTransaction")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - rpc.Service.TxFilter.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - rpc.Service.RawTransaction.getDefaultInstance())) - .build(); - } - } - } - return getGetTransactionMethod; - } - - private static volatile io.grpc.MethodDescriptor getSendTransactionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "SendTransaction", - requestType = rpc.Service.RawTransaction.class, - responseType = rpc.Service.SendResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getSendTransactionMethod() { - io.grpc.MethodDescriptor getSendTransactionMethod; - if ((getSendTransactionMethod = CompactTxStreamerGrpc.getSendTransactionMethod) == null) { - synchronized (CompactTxStreamerGrpc.class) { - if ((getSendTransactionMethod = CompactTxStreamerGrpc.getSendTransactionMethod) == null) { - CompactTxStreamerGrpc.getSendTransactionMethod = getSendTransactionMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "rpc.CompactTxStreamer", "SendTransaction")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - rpc.Service.RawTransaction.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - rpc.Service.SendResponse.getDefaultInstance())) - .build(); - } - } - } - return getSendTransactionMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static CompactTxStreamerStub newStub(io.grpc.Channel channel) { - return new CompactTxStreamerStub(channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static CompactTxStreamerBlockingStub newBlockingStub( - io.grpc.Channel channel) { - return new CompactTxStreamerBlockingStub(channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static CompactTxStreamerFutureStub newFutureStub( - io.grpc.Channel channel) { - return new CompactTxStreamerFutureStub(channel); - } - - /** - */ - public static abstract class CompactTxStreamerImplBase implements io.grpc.BindableService { - - /** - */ - public void getLatestBlock(rpc.Service.ChainSpec request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetLatestBlockMethod(), responseObserver); - } - - /** - */ - public void getBlock(rpc.Service.BlockID request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetBlockMethod(), responseObserver); - } - - /** - */ - public void getBlockRange(rpc.Service.BlockRange request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetBlockRangeMethod(), responseObserver); - } - - /** - */ - public void getTransaction(rpc.Service.TxFilter request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetTransactionMethod(), responseObserver); - } - - /** - */ - public void sendTransaction(rpc.Service.RawTransaction 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( - getGetLatestBlockMethod(), - asyncUnaryCall( - new MethodHandlers< - rpc.Service.ChainSpec, - rpc.Service.BlockID>( - this, METHODID_GET_LATEST_BLOCK))) - .addMethod( - getGetBlockMethod(), - asyncUnaryCall( - new MethodHandlers< - rpc.Service.BlockID, - rpc.CompactFormats.CompactBlock>( - this, METHODID_GET_BLOCK))) - .addMethod( - getGetBlockRangeMethod(), - asyncServerStreamingCall( - new MethodHandlers< - rpc.Service.BlockRange, - rpc.CompactFormats.CompactBlock>( - this, METHODID_GET_BLOCK_RANGE))) - .addMethod( - getGetTransactionMethod(), - asyncUnaryCall( - new MethodHandlers< - rpc.Service.TxFilter, - rpc.Service.RawTransaction>( - this, METHODID_GET_TRANSACTION))) - .addMethod( - getSendTransactionMethod(), - asyncUnaryCall( - new MethodHandlers< - rpc.Service.RawTransaction, - rpc.Service.SendResponse>( - this, METHODID_SEND_TRANSACTION))) - .build(); - } - } - - /** - */ - public static final class CompactTxStreamerStub extends io.grpc.stub.AbstractStub { - private CompactTxStreamerStub(io.grpc.Channel channel) { - super(channel); - } - - private CompactTxStreamerStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected CompactTxStreamerStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new CompactTxStreamerStub(channel, callOptions); - } - - /** - */ - public void getLatestBlock(rpc.Service.ChainSpec request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getGetLatestBlockMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getBlock(rpc.Service.BlockID request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getGetBlockMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getBlockRange(rpc.Service.BlockRange request, - io.grpc.stub.StreamObserver responseObserver) { - asyncServerStreamingCall( - getChannel().newCall(getGetBlockRangeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getTransaction(rpc.Service.TxFilter request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getGetTransactionMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void sendTransaction(rpc.Service.RawTransaction request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getSendTransactionMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class CompactTxStreamerBlockingStub extends io.grpc.stub.AbstractStub { - private CompactTxStreamerBlockingStub(io.grpc.Channel channel) { - super(channel); - } - - private CompactTxStreamerBlockingStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected CompactTxStreamerBlockingStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new CompactTxStreamerBlockingStub(channel, callOptions); - } - - /** - */ - public rpc.Service.BlockID getLatestBlock(rpc.Service.ChainSpec request) { - return blockingUnaryCall( - getChannel(), getGetLatestBlockMethod(), getCallOptions(), request); - } - - /** - */ - public rpc.CompactFormats.CompactBlock getBlock(rpc.Service.BlockID request) { - return blockingUnaryCall( - getChannel(), getGetBlockMethod(), getCallOptions(), request); - } - - /** - */ - public java.util.Iterator getBlockRange( - rpc.Service.BlockRange request) { - return blockingServerStreamingCall( - getChannel(), getGetBlockRangeMethod(), getCallOptions(), request); - } - - /** - */ - public rpc.Service.RawTransaction getTransaction(rpc.Service.TxFilter request) { - return blockingUnaryCall( - getChannel(), getGetTransactionMethod(), getCallOptions(), request); - } - - /** - */ - public rpc.Service.SendResponse sendTransaction(rpc.Service.RawTransaction request) { - return blockingUnaryCall( - getChannel(), getSendTransactionMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class CompactTxStreamerFutureStub extends io.grpc.stub.AbstractStub { - private CompactTxStreamerFutureStub(io.grpc.Channel channel) { - super(channel); - } - - private CompactTxStreamerFutureStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected CompactTxStreamerFutureStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new CompactTxStreamerFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getLatestBlock( - rpc.Service.ChainSpec request) { - return futureUnaryCall( - getChannel().newCall(getGetLatestBlockMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getBlock( - rpc.Service.BlockID request) { - return futureUnaryCall( - getChannel().newCall(getGetBlockMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getTransaction( - rpc.Service.TxFilter request) { - return futureUnaryCall( - getChannel().newCall(getGetTransactionMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture sendTransaction( - rpc.Service.RawTransaction request) { - return futureUnaryCall( - getChannel().newCall(getSendTransactionMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_GET_LATEST_BLOCK = 0; - private static final int METHODID_GET_BLOCK = 1; - private static final int METHODID_GET_BLOCK_RANGE = 2; - private static final int METHODID_GET_TRANSACTION = 3; - private static final int METHODID_SEND_TRANSACTION = 4; - - 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 CompactTxStreamerImplBase serviceImpl; - private final int methodId; - - MethodHandlers(CompactTxStreamerImplBase 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_GET_LATEST_BLOCK: - serviceImpl.getLatestBlock((rpc.Service.ChainSpec) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_BLOCK: - serviceImpl.getBlock((rpc.Service.BlockID) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_BLOCK_RANGE: - serviceImpl.getBlockRange((rpc.Service.BlockRange) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_TRANSACTION: - serviceImpl.getTransaction((rpc.Service.TxFilter) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_SEND_TRANSACTION: - serviceImpl.sendTransaction((rpc.Service.RawTransaction) 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 volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (CompactTxStreamerGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .addMethod(getGetLatestBlockMethod()) - .addMethod(getGetBlockMethod()) - .addMethod(getGetBlockRangeMethod()) - .addMethod(getGetTransactionMethod()) - .addMethod(getSendTransactionMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/src/generated/source/grpc/debug/javalite/rpc/CompactFormats.java b/src/generated/source/grpc/debug/javalite/rpc/CompactFormats.java deleted file mode 100644 index 28ba9a8a..00000000 --- a/src/generated/source/grpc/debug/javalite/rpc/CompactFormats.java +++ /dev/null @@ -1,2690 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: compact_formats.proto - -package rpc; - -public final class CompactFormats { - private CompactFormats() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - public interface CompactBlockOrBuilder extends - // @@protoc_insertion_point(interface_extends:rpc.CompactBlock) - com.google.protobuf.MessageLiteOrBuilder { - - /** - *
-     * the version of this wire format, for storage
-     * 
- * - * optional uint32 protoVersion = 1; - */ - int getProtoVersion(); - - /** - *
-     * the height of this block
-     * 
- * - * optional uint64 height = 2; - */ - long getHeight(); - - /** - * optional bytes hash = 3; - */ - com.google.protobuf.ByteString getHash(); - - /** - * optional uint32 time = 4; - */ - int getTime(); - - /** - *
-     * (hash and time) OR (full header)
-     * 
- * - * optional bytes header = 5; - */ - com.google.protobuf.ByteString getHeader(); - - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - java.util.List - getVtxList(); - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - rpc.CompactFormats.CompactTx getVtx(int index); - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - int getVtxCount(); - } - /** - *
-   * CompactBlock is a packaging of ONLY the data from a block that's needed to:
-   *   1. Detect a payment to your shielded Sapling address
-   *   2. Detect a spend of your shielded Sapling notes
-   *   3. Update your witnesses to generate new Sapling spend proofs.
-   * 
- * - * Protobuf type {@code rpc.CompactBlock} - */ - public static final class CompactBlock extends - com.google.protobuf.GeneratedMessageLite< - CompactBlock, CompactBlock.Builder> implements - // @@protoc_insertion_point(message_implements:rpc.CompactBlock) - CompactBlockOrBuilder { - private CompactBlock() { - hash_ = com.google.protobuf.ByteString.EMPTY; - header_ = com.google.protobuf.ByteString.EMPTY; - vtx_ = emptyProtobufList(); - } - private int bitField0_; - public static final int PROTOVERSION_FIELD_NUMBER = 1; - private int protoVersion_; - /** - *
-     * the version of this wire format, for storage
-     * 
- * - * optional uint32 protoVersion = 1; - */ - public int getProtoVersion() { - return protoVersion_; - } - /** - *
-     * the version of this wire format, for storage
-     * 
- * - * optional uint32 protoVersion = 1; - */ - private void setProtoVersion(int value) { - - protoVersion_ = value; - } - /** - *
-     * the version of this wire format, for storage
-     * 
- * - * optional uint32 protoVersion = 1; - */ - private void clearProtoVersion() { - - protoVersion_ = 0; - } - - public static final int HEIGHT_FIELD_NUMBER = 2; - private long height_; - /** - *
-     * the height of this block
-     * 
- * - * optional uint64 height = 2; - */ - public long getHeight() { - return height_; - } - /** - *
-     * the height of this block
-     * 
- * - * optional uint64 height = 2; - */ - private void setHeight(long value) { - - height_ = value; - } - /** - *
-     * the height of this block
-     * 
- * - * optional uint64 height = 2; - */ - private void clearHeight() { - - height_ = 0L; - } - - public static final int HASH_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString hash_; - /** - * optional bytes hash = 3; - */ - public com.google.protobuf.ByteString getHash() { - return hash_; - } - /** - * optional bytes hash = 3; - */ - private void setHash(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - hash_ = value; - } - /** - * optional bytes hash = 3; - */ - private void clearHash() { - - hash_ = getDefaultInstance().getHash(); - } - - public static final int TIME_FIELD_NUMBER = 4; - private int time_; - /** - * optional uint32 time = 4; - */ - public int getTime() { - return time_; - } - /** - * optional uint32 time = 4; - */ - private void setTime(int value) { - - time_ = value; - } - /** - * optional uint32 time = 4; - */ - private void clearTime() { - - time_ = 0; - } - - public static final int HEADER_FIELD_NUMBER = 5; - private com.google.protobuf.ByteString header_; - /** - *
-     * (hash and time) OR (full header)
-     * 
- * - * optional bytes header = 5; - */ - public com.google.protobuf.ByteString getHeader() { - return header_; - } - /** - *
-     * (hash and time) OR (full header)
-     * 
- * - * optional bytes header = 5; - */ - private void setHeader(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - header_ = value; - } - /** - *
-     * (hash and time) OR (full header)
-     * 
- * - * optional bytes header = 5; - */ - private void clearHeader() { - - header_ = getDefaultInstance().getHeader(); - } - - public static final int VTX_FIELD_NUMBER = 6; - private com.google.protobuf.Internal.ProtobufList vtx_; - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public java.util.List getVtxList() { - return vtx_; - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public java.util.List - getVtxOrBuilderList() { - return vtx_; - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public int getVtxCount() { - return vtx_.size(); - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public rpc.CompactFormats.CompactTx getVtx(int index) { - return vtx_.get(index); - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public rpc.CompactFormats.CompactTxOrBuilder getVtxOrBuilder( - int index) { - return vtx_.get(index); - } - private void ensureVtxIsMutable() { - if (!vtx_.isModifiable()) { - vtx_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(vtx_); - } - } - - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - private void setVtx( - int index, rpc.CompactFormats.CompactTx value) { - if (value == null) { - throw new NullPointerException(); - } - ensureVtxIsMutable(); - vtx_.set(index, value); - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - private void setVtx( - int index, rpc.CompactFormats.CompactTx.Builder builderForValue) { - ensureVtxIsMutable(); - vtx_.set(index, builderForValue.build()); - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - private void addVtx(rpc.CompactFormats.CompactTx value) { - if (value == null) { - throw new NullPointerException(); - } - ensureVtxIsMutable(); - vtx_.add(value); - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - private void addVtx( - int index, rpc.CompactFormats.CompactTx value) { - if (value == null) { - throw new NullPointerException(); - } - ensureVtxIsMutable(); - vtx_.add(index, value); - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - private void addVtx( - rpc.CompactFormats.CompactTx.Builder builderForValue) { - ensureVtxIsMutable(); - vtx_.add(builderForValue.build()); - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - private void addVtx( - int index, rpc.CompactFormats.CompactTx.Builder builderForValue) { - ensureVtxIsMutable(); - vtx_.add(index, builderForValue.build()); - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - private void addAllVtx( - java.lang.Iterable values) { - ensureVtxIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, vtx_); - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - private void clearVtx() { - vtx_ = emptyProtobufList(); - } - /** - *
-     * compact transactions from this block
-     * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - private void removeVtx(int index) { - ensureVtxIsMutable(); - vtx_.remove(index); - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (protoVersion_ != 0) { - output.writeUInt32(1, protoVersion_); - } - if (height_ != 0L) { - output.writeUInt64(2, height_); - } - if (!hash_.isEmpty()) { - output.writeBytes(3, hash_); - } - if (time_ != 0) { - output.writeUInt32(4, time_); - } - if (!header_.isEmpty()) { - output.writeBytes(5, header_); - } - for (int i = 0; i < vtx_.size(); i++) { - output.writeMessage(6, vtx_.get(i)); - } - } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (protoVersion_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, protoVersion_); - } - if (height_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, height_); - } - if (!hash_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, hash_); - } - if (time_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(4, time_); - } - if (!header_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, header_); - } - for (int i = 0; i < vtx_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, vtx_.get(i)); - } - memoizedSerializedSize = size; - return size; - } - - public static rpc.CompactFormats.CompactBlock parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.CompactFormats.CompactBlock parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.CompactFormats.CompactBlock parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.CompactFormats.CompactBlock parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.CompactFormats.CompactBlock parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactBlock parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.CompactFormats.CompactBlock parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactBlock parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.CompactFormats.CompactBlock parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactBlock parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(rpc.CompactFormats.CompactBlock prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - /** - *
-     * CompactBlock is a packaging of ONLY the data from a block that's needed to:
-     *   1. Detect a payment to your shielded Sapling address
-     *   2. Detect a spend of your shielded Sapling notes
-     *   3. Update your witnesses to generate new Sapling spend proofs.
-     * 
- * - * Protobuf type {@code rpc.CompactBlock} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - rpc.CompactFormats.CompactBlock, Builder> implements - // @@protoc_insertion_point(builder_implements:rpc.CompactBlock) - rpc.CompactFormats.CompactBlockOrBuilder { - // Construct using rpc.CompactFormats.CompactBlock.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - *
-       * the version of this wire format, for storage
-       * 
- * - * optional uint32 protoVersion = 1; - */ - public int getProtoVersion() { - return instance.getProtoVersion(); - } - /** - *
-       * the version of this wire format, for storage
-       * 
- * - * optional uint32 protoVersion = 1; - */ - public Builder setProtoVersion(int value) { - copyOnWrite(); - instance.setProtoVersion(value); - return this; - } - /** - *
-       * the version of this wire format, for storage
-       * 
- * - * optional uint32 protoVersion = 1; - */ - public Builder clearProtoVersion() { - copyOnWrite(); - instance.clearProtoVersion(); - return this; - } - - /** - *
-       * the height of this block
-       * 
- * - * optional uint64 height = 2; - */ - public long getHeight() { - return instance.getHeight(); - } - /** - *
-       * the height of this block
-       * 
- * - * optional uint64 height = 2; - */ - public Builder setHeight(long value) { - copyOnWrite(); - instance.setHeight(value); - return this; - } - /** - *
-       * the height of this block
-       * 
- * - * optional uint64 height = 2; - */ - public Builder clearHeight() { - copyOnWrite(); - instance.clearHeight(); - return this; - } - - /** - * optional bytes hash = 3; - */ - public com.google.protobuf.ByteString getHash() { - return instance.getHash(); - } - /** - * optional bytes hash = 3; - */ - public Builder setHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setHash(value); - return this; - } - /** - * optional bytes hash = 3; - */ - public Builder clearHash() { - copyOnWrite(); - instance.clearHash(); - return this; - } - - /** - * optional uint32 time = 4; - */ - public int getTime() { - return instance.getTime(); - } - /** - * optional uint32 time = 4; - */ - public Builder setTime(int value) { - copyOnWrite(); - instance.setTime(value); - return this; - } - /** - * optional uint32 time = 4; - */ - public Builder clearTime() { - copyOnWrite(); - instance.clearTime(); - return this; - } - - /** - *
-       * (hash and time) OR (full header)
-       * 
- * - * optional bytes header = 5; - */ - public com.google.protobuf.ByteString getHeader() { - return instance.getHeader(); - } - /** - *
-       * (hash and time) OR (full header)
-       * 
- * - * optional bytes header = 5; - */ - public Builder setHeader(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setHeader(value); - return this; - } - /** - *
-       * (hash and time) OR (full header)
-       * 
- * - * optional bytes header = 5; - */ - public Builder clearHeader() { - copyOnWrite(); - instance.clearHeader(); - return this; - } - - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public java.util.List getVtxList() { - return java.util.Collections.unmodifiableList( - instance.getVtxList()); - } - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public int getVtxCount() { - return instance.getVtxCount(); - }/** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public rpc.CompactFormats.CompactTx getVtx(int index) { - return instance.getVtx(index); - } - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public Builder setVtx( - int index, rpc.CompactFormats.CompactTx value) { - copyOnWrite(); - instance.setVtx(index, value); - return this; - } - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public Builder setVtx( - int index, rpc.CompactFormats.CompactTx.Builder builderForValue) { - copyOnWrite(); - instance.setVtx(index, builderForValue); - return this; - } - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public Builder addVtx(rpc.CompactFormats.CompactTx value) { - copyOnWrite(); - instance.addVtx(value); - return this; - } - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public Builder addVtx( - int index, rpc.CompactFormats.CompactTx value) { - copyOnWrite(); - instance.addVtx(index, value); - return this; - } - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public Builder addVtx( - rpc.CompactFormats.CompactTx.Builder builderForValue) { - copyOnWrite(); - instance.addVtx(builderForValue); - return this; - } - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public Builder addVtx( - int index, rpc.CompactFormats.CompactTx.Builder builderForValue) { - copyOnWrite(); - instance.addVtx(index, builderForValue); - return this; - } - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public Builder addAllVtx( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllVtx(values); - return this; - } - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public Builder clearVtx() { - copyOnWrite(); - instance.clearVtx(); - return this; - } - /** - *
-       * compact transactions from this block
-       * 
- * - * repeated .rpc.CompactTx vtx = 6; - */ - public Builder removeVtx(int index) { - copyOnWrite(); - instance.removeVtx(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:rpc.CompactBlock) - } - protected final Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - Object arg0, Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new rpc.CompactFormats.CompactBlock(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - vtx_.makeImmutable(); - return null; - } - case NEW_BUILDER: { - return new Builder(); - } - case VISIT: { - Visitor visitor = (Visitor) arg0; - rpc.CompactFormats.CompactBlock other = (rpc.CompactFormats.CompactBlock) arg1; - protoVersion_ = visitor.visitInt(protoVersion_ != 0, protoVersion_, - other.protoVersion_ != 0, other.protoVersion_); - height_ = visitor.visitLong(height_ != 0L, height_, - other.height_ != 0L, other.height_); - hash_ = visitor.visitByteString(hash_ != com.google.protobuf.ByteString.EMPTY, hash_, - other.hash_ != com.google.protobuf.ByteString.EMPTY, other.hash_); - time_ = visitor.visitInt(time_ != 0, time_, - other.time_ != 0, other.time_); - header_ = visitor.visitByteString(header_ != com.google.protobuf.ByteString.EMPTY, header_, - other.header_ != com.google.protobuf.ByteString.EMPTY, other.header_); - vtx_= visitor.visitList(vtx_, other.vtx_); - if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor - .INSTANCE) { - bitField0_ |= other.bitField0_; - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - protoVersion_ = input.readUInt32(); - break; - } - case 16: { - - height_ = input.readUInt64(); - break; - } - case 26: { - - hash_ = input.readBytes(); - break; - } - case 32: { - - time_ = input.readUInt32(); - break; - } - case 42: { - - header_ = input.readBytes(); - break; - } - case 50: { - if (!vtx_.isModifiable()) { - vtx_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(vtx_); - } - vtx_.add( - input.readMessage(rpc.CompactFormats.CompactTx.parser(), extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } - } - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - if (PARSER == null) { synchronized (rpc.CompactFormats.CompactBlock.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); - } - } - } - return PARSER; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:rpc.CompactBlock) - private static final rpc.CompactFormats.CompactBlock DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new CompactBlock(); - DEFAULT_INSTANCE.makeImmutable(); - } - - public static rpc.CompactFormats.CompactBlock getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface CompactTxOrBuilder extends - // @@protoc_insertion_point(interface_extends:rpc.CompactTx) - com.google.protobuf.MessageLiteOrBuilder { - - /** - *
-     * Index and hash will allow the receiver to call out to chain
-     * explorers or other data structures to retrieve more information
-     * about this transaction.
-     * 
- * - * optional uint64 index = 1; - */ - long getIndex(); - - /** - * optional bytes hash = 2; - */ - com.google.protobuf.ByteString getHash(); - - /** - *
-     * The transaction fee: present if server can provide. In the case of a
-     * stateless server and a transaction with transparent inputs, this will be
-     * unset because the calculation requires reference to prior transactions.
-     * in a pure-Sapling context, the fee will be calculable as:
-     *    valueBalance + (sum(vPubNew) - sum(vPubOld) - sum(tOut))
-     * 
- * - * optional uint32 fee = 3; - */ - int getFee(); - - /** - * repeated .rpc.CompactSpend spends = 4; - */ - java.util.List - getSpendsList(); - /** - * repeated .rpc.CompactSpend spends = 4; - */ - rpc.CompactFormats.CompactSpend getSpends(int index); - /** - * repeated .rpc.CompactSpend spends = 4; - */ - int getSpendsCount(); - - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - java.util.List - getOutputsList(); - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - rpc.CompactFormats.CompactOutput getOutputs(int index); - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - int getOutputsCount(); - } - /** - * Protobuf type {@code rpc.CompactTx} - */ - public static final class CompactTx extends - com.google.protobuf.GeneratedMessageLite< - CompactTx, CompactTx.Builder> implements - // @@protoc_insertion_point(message_implements:rpc.CompactTx) - CompactTxOrBuilder { - private CompactTx() { - hash_ = com.google.protobuf.ByteString.EMPTY; - spends_ = emptyProtobufList(); - outputs_ = emptyProtobufList(); - } - private int bitField0_; - public static final int INDEX_FIELD_NUMBER = 1; - private long index_; - /** - *
-     * Index and hash will allow the receiver to call out to chain
-     * explorers or other data structures to retrieve more information
-     * about this transaction.
-     * 
- * - * optional uint64 index = 1; - */ - public long getIndex() { - return index_; - } - /** - *
-     * Index and hash will allow the receiver to call out to chain
-     * explorers or other data structures to retrieve more information
-     * about this transaction.
-     * 
- * - * optional uint64 index = 1; - */ - private void setIndex(long value) { - - index_ = value; - } - /** - *
-     * Index and hash will allow the receiver to call out to chain
-     * explorers or other data structures to retrieve more information
-     * about this transaction.
-     * 
- * - * optional uint64 index = 1; - */ - private void clearIndex() { - - index_ = 0L; - } - - public static final int HASH_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString hash_; - /** - * optional bytes hash = 2; - */ - public com.google.protobuf.ByteString getHash() { - return hash_; - } - /** - * optional bytes hash = 2; - */ - private void setHash(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - hash_ = value; - } - /** - * optional bytes hash = 2; - */ - private void clearHash() { - - hash_ = getDefaultInstance().getHash(); - } - - public static final int FEE_FIELD_NUMBER = 3; - private int fee_; - /** - *
-     * The transaction fee: present if server can provide. In the case of a
-     * stateless server and a transaction with transparent inputs, this will be
-     * unset because the calculation requires reference to prior transactions.
-     * in a pure-Sapling context, the fee will be calculable as:
-     *    valueBalance + (sum(vPubNew) - sum(vPubOld) - sum(tOut))
-     * 
- * - * optional uint32 fee = 3; - */ - public int getFee() { - return fee_; - } - /** - *
-     * The transaction fee: present if server can provide. In the case of a
-     * stateless server and a transaction with transparent inputs, this will be
-     * unset because the calculation requires reference to prior transactions.
-     * in a pure-Sapling context, the fee will be calculable as:
-     *    valueBalance + (sum(vPubNew) - sum(vPubOld) - sum(tOut))
-     * 
- * - * optional uint32 fee = 3; - */ - private void setFee(int value) { - - fee_ = value; - } - /** - *
-     * The transaction fee: present if server can provide. In the case of a
-     * stateless server and a transaction with transparent inputs, this will be
-     * unset because the calculation requires reference to prior transactions.
-     * in a pure-Sapling context, the fee will be calculable as:
-     *    valueBalance + (sum(vPubNew) - sum(vPubOld) - sum(tOut))
-     * 
- * - * optional uint32 fee = 3; - */ - private void clearFee() { - - fee_ = 0; - } - - public static final int SPENDS_FIELD_NUMBER = 4; - private com.google.protobuf.Internal.ProtobufList spends_; - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public java.util.List getSpendsList() { - return spends_; - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public java.util.List - getSpendsOrBuilderList() { - return spends_; - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public int getSpendsCount() { - return spends_.size(); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public rpc.CompactFormats.CompactSpend getSpends(int index) { - return spends_.get(index); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public rpc.CompactFormats.CompactSpendOrBuilder getSpendsOrBuilder( - int index) { - return spends_.get(index); - } - private void ensureSpendsIsMutable() { - if (!spends_.isModifiable()) { - spends_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(spends_); - } - } - - /** - * repeated .rpc.CompactSpend spends = 4; - */ - private void setSpends( - int index, rpc.CompactFormats.CompactSpend value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpendsIsMutable(); - spends_.set(index, value); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - private void setSpends( - int index, rpc.CompactFormats.CompactSpend.Builder builderForValue) { - ensureSpendsIsMutable(); - spends_.set(index, builderForValue.build()); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - private void addSpends(rpc.CompactFormats.CompactSpend value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpendsIsMutable(); - spends_.add(value); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - private void addSpends( - int index, rpc.CompactFormats.CompactSpend value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpendsIsMutable(); - spends_.add(index, value); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - private void addSpends( - rpc.CompactFormats.CompactSpend.Builder builderForValue) { - ensureSpendsIsMutable(); - spends_.add(builderForValue.build()); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - private void addSpends( - int index, rpc.CompactFormats.CompactSpend.Builder builderForValue) { - ensureSpendsIsMutable(); - spends_.add(index, builderForValue.build()); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - private void addAllSpends( - java.lang.Iterable values) { - ensureSpendsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, spends_); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - private void clearSpends() { - spends_ = emptyProtobufList(); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - private void removeSpends(int index) { - ensureSpendsIsMutable(); - spends_.remove(index); - } - - public static final int OUTPUTS_FIELD_NUMBER = 5; - private com.google.protobuf.Internal.ProtobufList outputs_; - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public java.util.List getOutputsList() { - return outputs_; - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public java.util.List - getOutputsOrBuilderList() { - return outputs_; - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public int getOutputsCount() { - return outputs_.size(); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public rpc.CompactFormats.CompactOutput getOutputs(int index) { - return outputs_.get(index); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public rpc.CompactFormats.CompactOutputOrBuilder getOutputsOrBuilder( - int index) { - return outputs_.get(index); - } - private void ensureOutputsIsMutable() { - if (!outputs_.isModifiable()) { - outputs_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(outputs_); - } - } - - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - private void setOutputs( - int index, rpc.CompactFormats.CompactOutput value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputsIsMutable(); - outputs_.set(index, value); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - private void setOutputs( - int index, rpc.CompactFormats.CompactOutput.Builder builderForValue) { - ensureOutputsIsMutable(); - outputs_.set(index, builderForValue.build()); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - private void addOutputs(rpc.CompactFormats.CompactOutput value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputsIsMutable(); - outputs_.add(value); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - private void addOutputs( - int index, rpc.CompactFormats.CompactOutput value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputsIsMutable(); - outputs_.add(index, value); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - private void addOutputs( - rpc.CompactFormats.CompactOutput.Builder builderForValue) { - ensureOutputsIsMutable(); - outputs_.add(builderForValue.build()); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - private void addOutputs( - int index, rpc.CompactFormats.CompactOutput.Builder builderForValue) { - ensureOutputsIsMutable(); - outputs_.add(index, builderForValue.build()); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - private void addAllOutputs( - java.lang.Iterable values) { - ensureOutputsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, outputs_); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - private void clearOutputs() { - outputs_ = emptyProtobufList(); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - private void removeOutputs(int index) { - ensureOutputsIsMutable(); - outputs_.remove(index); - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (index_ != 0L) { - output.writeUInt64(1, index_); - } - if (!hash_.isEmpty()) { - output.writeBytes(2, hash_); - } - if (fee_ != 0) { - output.writeUInt32(3, fee_); - } - for (int i = 0; i < spends_.size(); i++) { - output.writeMessage(4, spends_.get(i)); - } - for (int i = 0; i < outputs_.size(); i++) { - output.writeMessage(5, outputs_.get(i)); - } - } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (index_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, index_); - } - if (!hash_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, hash_); - } - if (fee_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(3, fee_); - } - for (int i = 0; i < spends_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, spends_.get(i)); - } - for (int i = 0; i < outputs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, outputs_.get(i)); - } - memoizedSerializedSize = size; - return size; - } - - public static rpc.CompactFormats.CompactTx parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.CompactFormats.CompactTx parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.CompactFormats.CompactTx parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.CompactFormats.CompactTx parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.CompactFormats.CompactTx parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactTx parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.CompactFormats.CompactTx parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactTx parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.CompactFormats.CompactTx parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactTx parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(rpc.CompactFormats.CompactTx prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - /** - * Protobuf type {@code rpc.CompactTx} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - rpc.CompactFormats.CompactTx, Builder> implements - // @@protoc_insertion_point(builder_implements:rpc.CompactTx) - rpc.CompactFormats.CompactTxOrBuilder { - // Construct using rpc.CompactFormats.CompactTx.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - *
-       * Index and hash will allow the receiver to call out to chain
-       * explorers or other data structures to retrieve more information
-       * about this transaction.
-       * 
- * - * optional uint64 index = 1; - */ - public long getIndex() { - return instance.getIndex(); - } - /** - *
-       * Index and hash will allow the receiver to call out to chain
-       * explorers or other data structures to retrieve more information
-       * about this transaction.
-       * 
- * - * optional uint64 index = 1; - */ - public Builder setIndex(long value) { - copyOnWrite(); - instance.setIndex(value); - return this; - } - /** - *
-       * Index and hash will allow the receiver to call out to chain
-       * explorers or other data structures to retrieve more information
-       * about this transaction.
-       * 
- * - * optional uint64 index = 1; - */ - public Builder clearIndex() { - copyOnWrite(); - instance.clearIndex(); - return this; - } - - /** - * optional bytes hash = 2; - */ - public com.google.protobuf.ByteString getHash() { - return instance.getHash(); - } - /** - * optional bytes hash = 2; - */ - public Builder setHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setHash(value); - return this; - } - /** - * optional bytes hash = 2; - */ - public Builder clearHash() { - copyOnWrite(); - instance.clearHash(); - return this; - } - - /** - *
-       * The transaction fee: present if server can provide. In the case of a
-       * stateless server and a transaction with transparent inputs, this will be
-       * unset because the calculation requires reference to prior transactions.
-       * in a pure-Sapling context, the fee will be calculable as:
-       *    valueBalance + (sum(vPubNew) - sum(vPubOld) - sum(tOut))
-       * 
- * - * optional uint32 fee = 3; - */ - public int getFee() { - return instance.getFee(); - } - /** - *
-       * The transaction fee: present if server can provide. In the case of a
-       * stateless server and a transaction with transparent inputs, this will be
-       * unset because the calculation requires reference to prior transactions.
-       * in a pure-Sapling context, the fee will be calculable as:
-       *    valueBalance + (sum(vPubNew) - sum(vPubOld) - sum(tOut))
-       * 
- * - * optional uint32 fee = 3; - */ - public Builder setFee(int value) { - copyOnWrite(); - instance.setFee(value); - return this; - } - /** - *
-       * The transaction fee: present if server can provide. In the case of a
-       * stateless server and a transaction with transparent inputs, this will be
-       * unset because the calculation requires reference to prior transactions.
-       * in a pure-Sapling context, the fee will be calculable as:
-       *    valueBalance + (sum(vPubNew) - sum(vPubOld) - sum(tOut))
-       * 
- * - * optional uint32 fee = 3; - */ - public Builder clearFee() { - copyOnWrite(); - instance.clearFee(); - return this; - } - - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public java.util.List getSpendsList() { - return java.util.Collections.unmodifiableList( - instance.getSpendsList()); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public int getSpendsCount() { - return instance.getSpendsCount(); - }/** - * repeated .rpc.CompactSpend spends = 4; - */ - public rpc.CompactFormats.CompactSpend getSpends(int index) { - return instance.getSpends(index); - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public Builder setSpends( - int index, rpc.CompactFormats.CompactSpend value) { - copyOnWrite(); - instance.setSpends(index, value); - return this; - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public Builder setSpends( - int index, rpc.CompactFormats.CompactSpend.Builder builderForValue) { - copyOnWrite(); - instance.setSpends(index, builderForValue); - return this; - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public Builder addSpends(rpc.CompactFormats.CompactSpend value) { - copyOnWrite(); - instance.addSpends(value); - return this; - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public Builder addSpends( - int index, rpc.CompactFormats.CompactSpend value) { - copyOnWrite(); - instance.addSpends(index, value); - return this; - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public Builder addSpends( - rpc.CompactFormats.CompactSpend.Builder builderForValue) { - copyOnWrite(); - instance.addSpends(builderForValue); - return this; - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public Builder addSpends( - int index, rpc.CompactFormats.CompactSpend.Builder builderForValue) { - copyOnWrite(); - instance.addSpends(index, builderForValue); - return this; - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public Builder addAllSpends( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllSpends(values); - return this; - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public Builder clearSpends() { - copyOnWrite(); - instance.clearSpends(); - return this; - } - /** - * repeated .rpc.CompactSpend spends = 4; - */ - public Builder removeSpends(int index) { - copyOnWrite(); - instance.removeSpends(index); - return this; - } - - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public java.util.List getOutputsList() { - return java.util.Collections.unmodifiableList( - instance.getOutputsList()); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public int getOutputsCount() { - return instance.getOutputsCount(); - }/** - * repeated .rpc.CompactOutput outputs = 5; - */ - public rpc.CompactFormats.CompactOutput getOutputs(int index) { - return instance.getOutputs(index); - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public Builder setOutputs( - int index, rpc.CompactFormats.CompactOutput value) { - copyOnWrite(); - instance.setOutputs(index, value); - return this; - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public Builder setOutputs( - int index, rpc.CompactFormats.CompactOutput.Builder builderForValue) { - copyOnWrite(); - instance.setOutputs(index, builderForValue); - return this; - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public Builder addOutputs(rpc.CompactFormats.CompactOutput value) { - copyOnWrite(); - instance.addOutputs(value); - return this; - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public Builder addOutputs( - int index, rpc.CompactFormats.CompactOutput value) { - copyOnWrite(); - instance.addOutputs(index, value); - return this; - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public Builder addOutputs( - rpc.CompactFormats.CompactOutput.Builder builderForValue) { - copyOnWrite(); - instance.addOutputs(builderForValue); - return this; - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public Builder addOutputs( - int index, rpc.CompactFormats.CompactOutput.Builder builderForValue) { - copyOnWrite(); - instance.addOutputs(index, builderForValue); - return this; - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public Builder addAllOutputs( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllOutputs(values); - return this; - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public Builder clearOutputs() { - copyOnWrite(); - instance.clearOutputs(); - return this; - } - /** - * repeated .rpc.CompactOutput outputs = 5; - */ - public Builder removeOutputs(int index) { - copyOnWrite(); - instance.removeOutputs(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:rpc.CompactTx) - } - protected final Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - Object arg0, Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new rpc.CompactFormats.CompactTx(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - spends_.makeImmutable(); - outputs_.makeImmutable(); - return null; - } - case NEW_BUILDER: { - return new Builder(); - } - case VISIT: { - Visitor visitor = (Visitor) arg0; - rpc.CompactFormats.CompactTx other = (rpc.CompactFormats.CompactTx) arg1; - index_ = visitor.visitLong(index_ != 0L, index_, - other.index_ != 0L, other.index_); - hash_ = visitor.visitByteString(hash_ != com.google.protobuf.ByteString.EMPTY, hash_, - other.hash_ != com.google.protobuf.ByteString.EMPTY, other.hash_); - fee_ = visitor.visitInt(fee_ != 0, fee_, - other.fee_ != 0, other.fee_); - spends_= visitor.visitList(spends_, other.spends_); - outputs_= visitor.visitList(outputs_, other.outputs_); - if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor - .INSTANCE) { - bitField0_ |= other.bitField0_; - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - index_ = input.readUInt64(); - break; - } - case 18: { - - hash_ = input.readBytes(); - break; - } - case 24: { - - fee_ = input.readUInt32(); - break; - } - case 34: { - if (!spends_.isModifiable()) { - spends_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(spends_); - } - spends_.add( - input.readMessage(rpc.CompactFormats.CompactSpend.parser(), extensionRegistry)); - break; - } - case 42: { - if (!outputs_.isModifiable()) { - outputs_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(outputs_); - } - outputs_.add( - input.readMessage(rpc.CompactFormats.CompactOutput.parser(), extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } - } - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - if (PARSER == null) { synchronized (rpc.CompactFormats.CompactTx.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); - } - } - } - return PARSER; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:rpc.CompactTx) - private static final rpc.CompactFormats.CompactTx DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new CompactTx(); - DEFAULT_INSTANCE.makeImmutable(); - } - - public static rpc.CompactFormats.CompactTx getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface CompactSpendOrBuilder extends - // @@protoc_insertion_point(interface_extends:rpc.CompactSpend) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional bytes nf = 1; - */ - com.google.protobuf.ByteString getNf(); - } - /** - * Protobuf type {@code rpc.CompactSpend} - */ - public static final class CompactSpend extends - com.google.protobuf.GeneratedMessageLite< - CompactSpend, CompactSpend.Builder> implements - // @@protoc_insertion_point(message_implements:rpc.CompactSpend) - CompactSpendOrBuilder { - private CompactSpend() { - nf_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int NF_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString nf_; - /** - * optional bytes nf = 1; - */ - public com.google.protobuf.ByteString getNf() { - return nf_; - } - /** - * optional bytes nf = 1; - */ - private void setNf(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - nf_ = value; - } - /** - * optional bytes nf = 1; - */ - private void clearNf() { - - nf_ = getDefaultInstance().getNf(); - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!nf_.isEmpty()) { - output.writeBytes(1, nf_); - } - } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (!nf_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, nf_); - } - memoizedSerializedSize = size; - return size; - } - - public static rpc.CompactFormats.CompactSpend parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.CompactFormats.CompactSpend parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.CompactFormats.CompactSpend parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.CompactFormats.CompactSpend parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.CompactFormats.CompactSpend parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactSpend parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.CompactFormats.CompactSpend parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactSpend parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.CompactFormats.CompactSpend parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactSpend parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(rpc.CompactFormats.CompactSpend prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - /** - * Protobuf type {@code rpc.CompactSpend} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - rpc.CompactFormats.CompactSpend, Builder> implements - // @@protoc_insertion_point(builder_implements:rpc.CompactSpend) - rpc.CompactFormats.CompactSpendOrBuilder { - // Construct using rpc.CompactFormats.CompactSpend.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional bytes nf = 1; - */ - public com.google.protobuf.ByteString getNf() { - return instance.getNf(); - } - /** - * optional bytes nf = 1; - */ - public Builder setNf(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setNf(value); - return this; - } - /** - * optional bytes nf = 1; - */ - public Builder clearNf() { - copyOnWrite(); - instance.clearNf(); - return this; - } - - // @@protoc_insertion_point(builder_scope:rpc.CompactSpend) - } - protected final Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - Object arg0, Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new rpc.CompactFormats.CompactSpend(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - return null; - } - case NEW_BUILDER: { - return new Builder(); - } - case VISIT: { - Visitor visitor = (Visitor) arg0; - rpc.CompactFormats.CompactSpend other = (rpc.CompactFormats.CompactSpend) arg1; - nf_ = visitor.visitByteString(nf_ != com.google.protobuf.ByteString.EMPTY, nf_, - other.nf_ != com.google.protobuf.ByteString.EMPTY, other.nf_); - if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor - .INSTANCE) { - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - - nf_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } - } - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - if (PARSER == null) { synchronized (rpc.CompactFormats.CompactSpend.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); - } - } - } - return PARSER; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:rpc.CompactSpend) - private static final rpc.CompactFormats.CompactSpend DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new CompactSpend(); - DEFAULT_INSTANCE.makeImmutable(); - } - - public static rpc.CompactFormats.CompactSpend getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface CompactOutputOrBuilder extends - // @@protoc_insertion_point(interface_extends:rpc.CompactOutput) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional bytes cmu = 1; - */ - com.google.protobuf.ByteString getCmu(); - - /** - * optional bytes epk = 2; - */ - com.google.protobuf.ByteString getEpk(); - - /** - * optional bytes ciphertext = 3; - */ - com.google.protobuf.ByteString getCiphertext(); - } - /** - * Protobuf type {@code rpc.CompactOutput} - */ - public static final class CompactOutput extends - com.google.protobuf.GeneratedMessageLite< - CompactOutput, CompactOutput.Builder> implements - // @@protoc_insertion_point(message_implements:rpc.CompactOutput) - CompactOutputOrBuilder { - private CompactOutput() { - cmu_ = com.google.protobuf.ByteString.EMPTY; - epk_ = com.google.protobuf.ByteString.EMPTY; - ciphertext_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int CMU_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString cmu_; - /** - * optional bytes cmu = 1; - */ - public com.google.protobuf.ByteString getCmu() { - return cmu_; - } - /** - * optional bytes cmu = 1; - */ - private void setCmu(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - cmu_ = value; - } - /** - * optional bytes cmu = 1; - */ - private void clearCmu() { - - cmu_ = getDefaultInstance().getCmu(); - } - - public static final int EPK_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString epk_; - /** - * optional bytes epk = 2; - */ - public com.google.protobuf.ByteString getEpk() { - return epk_; - } - /** - * optional bytes epk = 2; - */ - private void setEpk(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - epk_ = value; - } - /** - * optional bytes epk = 2; - */ - private void clearEpk() { - - epk_ = getDefaultInstance().getEpk(); - } - - public static final int CIPHERTEXT_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString ciphertext_; - /** - * optional bytes ciphertext = 3; - */ - public com.google.protobuf.ByteString getCiphertext() { - return ciphertext_; - } - /** - * optional bytes ciphertext = 3; - */ - private void setCiphertext(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - ciphertext_ = value; - } - /** - * optional bytes ciphertext = 3; - */ - private void clearCiphertext() { - - ciphertext_ = getDefaultInstance().getCiphertext(); - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!cmu_.isEmpty()) { - output.writeBytes(1, cmu_); - } - if (!epk_.isEmpty()) { - output.writeBytes(2, epk_); - } - if (!ciphertext_.isEmpty()) { - output.writeBytes(3, ciphertext_); - } - } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (!cmu_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, cmu_); - } - if (!epk_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, epk_); - } - if (!ciphertext_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, ciphertext_); - } - memoizedSerializedSize = size; - return size; - } - - public static rpc.CompactFormats.CompactOutput parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.CompactFormats.CompactOutput parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.CompactFormats.CompactOutput parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.CompactFormats.CompactOutput parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.CompactFormats.CompactOutput parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactOutput parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.CompactFormats.CompactOutput parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactOutput parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.CompactFormats.CompactOutput parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.CompactFormats.CompactOutput parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(rpc.CompactFormats.CompactOutput prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - /** - * Protobuf type {@code rpc.CompactOutput} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - rpc.CompactFormats.CompactOutput, Builder> implements - // @@protoc_insertion_point(builder_implements:rpc.CompactOutput) - rpc.CompactFormats.CompactOutputOrBuilder { - // Construct using rpc.CompactFormats.CompactOutput.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional bytes cmu = 1; - */ - public com.google.protobuf.ByteString getCmu() { - return instance.getCmu(); - } - /** - * optional bytes cmu = 1; - */ - public Builder setCmu(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setCmu(value); - return this; - } - /** - * optional bytes cmu = 1; - */ - public Builder clearCmu() { - copyOnWrite(); - instance.clearCmu(); - return this; - } - - /** - * optional bytes epk = 2; - */ - public com.google.protobuf.ByteString getEpk() { - return instance.getEpk(); - } - /** - * optional bytes epk = 2; - */ - public Builder setEpk(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setEpk(value); - return this; - } - /** - * optional bytes epk = 2; - */ - public Builder clearEpk() { - copyOnWrite(); - instance.clearEpk(); - return this; - } - - /** - * optional bytes ciphertext = 3; - */ - public com.google.protobuf.ByteString getCiphertext() { - return instance.getCiphertext(); - } - /** - * optional bytes ciphertext = 3; - */ - public Builder setCiphertext(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setCiphertext(value); - return this; - } - /** - * optional bytes ciphertext = 3; - */ - public Builder clearCiphertext() { - copyOnWrite(); - instance.clearCiphertext(); - return this; - } - - // @@protoc_insertion_point(builder_scope:rpc.CompactOutput) - } - protected final Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - Object arg0, Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new rpc.CompactFormats.CompactOutput(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - return null; - } - case NEW_BUILDER: { - return new Builder(); - } - case VISIT: { - Visitor visitor = (Visitor) arg0; - rpc.CompactFormats.CompactOutput other = (rpc.CompactFormats.CompactOutput) arg1; - cmu_ = visitor.visitByteString(cmu_ != com.google.protobuf.ByteString.EMPTY, cmu_, - other.cmu_ != com.google.protobuf.ByteString.EMPTY, other.cmu_); - epk_ = visitor.visitByteString(epk_ != com.google.protobuf.ByteString.EMPTY, epk_, - other.epk_ != com.google.protobuf.ByteString.EMPTY, other.epk_); - ciphertext_ = visitor.visitByteString(ciphertext_ != com.google.protobuf.ByteString.EMPTY, ciphertext_, - other.ciphertext_ != com.google.protobuf.ByteString.EMPTY, other.ciphertext_); - if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor - .INSTANCE) { - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - - cmu_ = input.readBytes(); - break; - } - case 18: { - - epk_ = input.readBytes(); - break; - } - case 26: { - - ciphertext_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } - } - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - if (PARSER == null) { synchronized (rpc.CompactFormats.CompactOutput.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); - } - } - } - return PARSER; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:rpc.CompactOutput) - private static final rpc.CompactFormats.CompactOutput DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new CompactOutput(); - DEFAULT_INSTANCE.makeImmutable(); - } - - public static rpc.CompactFormats.CompactOutput getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - - static { - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/src/generated/source/grpc/debug/javalite/rpc/Service.java b/src/generated/source/grpc/debug/javalite/rpc/Service.java deleted file mode 100644 index 0f981103..00000000 --- a/src/generated/source/grpc/debug/javalite/rpc/Service.java +++ /dev/null @@ -1,2159 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: service.proto - -package rpc; - -public final class Service { - private Service() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - public interface BlockIDOrBuilder extends - // @@protoc_insertion_point(interface_extends:rpc.BlockID) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional uint64 height = 1; - */ - long getHeight(); - - /** - * optional bytes hash = 2; - */ - com.google.protobuf.ByteString getHash(); - } - /** - *
-   * A BlockID message contains identifiers to select a block: a height or a
-   * hash. If the hash is present it takes precedence.
-   * 
- * - * Protobuf type {@code rpc.BlockID} - */ - public static final class BlockID extends - com.google.protobuf.GeneratedMessageLite< - BlockID, BlockID.Builder> implements - // @@protoc_insertion_point(message_implements:rpc.BlockID) - BlockIDOrBuilder { - private BlockID() { - hash_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int HEIGHT_FIELD_NUMBER = 1; - private long height_; - /** - * optional uint64 height = 1; - */ - public long getHeight() { - return height_; - } - /** - * optional uint64 height = 1; - */ - private void setHeight(long value) { - - height_ = value; - } - /** - * optional uint64 height = 1; - */ - private void clearHeight() { - - height_ = 0L; - } - - public static final int HASH_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString hash_; - /** - * optional bytes hash = 2; - */ - public com.google.protobuf.ByteString getHash() { - return hash_; - } - /** - * optional bytes hash = 2; - */ - private void setHash(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - hash_ = value; - } - /** - * optional bytes hash = 2; - */ - private void clearHash() { - - hash_ = getDefaultInstance().getHash(); - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (height_ != 0L) { - output.writeUInt64(1, height_); - } - if (!hash_.isEmpty()) { - output.writeBytes(2, hash_); - } - } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (height_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, height_); - } - if (!hash_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, hash_); - } - memoizedSerializedSize = size; - return size; - } - - public static rpc.Service.BlockID parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.BlockID parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.BlockID parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.BlockID parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.BlockID parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.BlockID parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.BlockID parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static rpc.Service.BlockID parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.BlockID parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.BlockID parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(rpc.Service.BlockID prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - /** - *
-     * A BlockID message contains identifiers to select a block: a height or a
-     * hash. If the hash is present it takes precedence.
-     * 
- * - * Protobuf type {@code rpc.BlockID} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - rpc.Service.BlockID, Builder> implements - // @@protoc_insertion_point(builder_implements:rpc.BlockID) - rpc.Service.BlockIDOrBuilder { - // Construct using rpc.Service.BlockID.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional uint64 height = 1; - */ - public long getHeight() { - return instance.getHeight(); - } - /** - * optional uint64 height = 1; - */ - public Builder setHeight(long value) { - copyOnWrite(); - instance.setHeight(value); - return this; - } - /** - * optional uint64 height = 1; - */ - public Builder clearHeight() { - copyOnWrite(); - instance.clearHeight(); - return this; - } - - /** - * optional bytes hash = 2; - */ - public com.google.protobuf.ByteString getHash() { - return instance.getHash(); - } - /** - * optional bytes hash = 2; - */ - public Builder setHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setHash(value); - return this; - } - /** - * optional bytes hash = 2; - */ - public Builder clearHash() { - copyOnWrite(); - instance.clearHash(); - return this; - } - - // @@protoc_insertion_point(builder_scope:rpc.BlockID) - } - protected final Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - Object arg0, Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new rpc.Service.BlockID(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - return null; - } - case NEW_BUILDER: { - return new Builder(); - } - case VISIT: { - Visitor visitor = (Visitor) arg0; - rpc.Service.BlockID other = (rpc.Service.BlockID) arg1; - height_ = visitor.visitLong(height_ != 0L, height_, - other.height_ != 0L, other.height_); - hash_ = visitor.visitByteString(hash_ != com.google.protobuf.ByteString.EMPTY, hash_, - other.hash_ != com.google.protobuf.ByteString.EMPTY, other.hash_); - if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor - .INSTANCE) { - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - height_ = input.readUInt64(); - break; - } - case 18: { - - hash_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } - } - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - if (PARSER == null) { synchronized (rpc.Service.BlockID.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); - } - } - } - return PARSER; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:rpc.BlockID) - private static final rpc.Service.BlockID DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new BlockID(); - DEFAULT_INSTANCE.makeImmutable(); - } - - public static rpc.Service.BlockID getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface BlockRangeOrBuilder extends - // @@protoc_insertion_point(interface_extends:rpc.BlockRange) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional .rpc.BlockID start = 1; - */ - boolean hasStart(); - /** - * optional .rpc.BlockID start = 1; - */ - rpc.Service.BlockID getStart(); - - /** - * optional .rpc.BlockID end = 2; - */ - boolean hasEnd(); - /** - * optional .rpc.BlockID end = 2; - */ - rpc.Service.BlockID getEnd(); - } - /** - *
-   * BlockRange technically allows ranging from hash to hash etc but this is not
-   * currently intended for support, though there is no reason you couldn't do
-   * it. Further permutations are left as an exercise.
-   * 
- * - * Protobuf type {@code rpc.BlockRange} - */ - public static final class BlockRange extends - com.google.protobuf.GeneratedMessageLite< - BlockRange, BlockRange.Builder> implements - // @@protoc_insertion_point(message_implements:rpc.BlockRange) - BlockRangeOrBuilder { - private BlockRange() { - } - public static final int START_FIELD_NUMBER = 1; - private rpc.Service.BlockID start_; - /** - * optional .rpc.BlockID start = 1; - */ - public boolean hasStart() { - return start_ != null; - } - /** - * optional .rpc.BlockID start = 1; - */ - public rpc.Service.BlockID getStart() { - return start_ == null ? rpc.Service.BlockID.getDefaultInstance() : start_; - } - /** - * optional .rpc.BlockID start = 1; - */ - private void setStart(rpc.Service.BlockID value) { - if (value == null) { - throw new NullPointerException(); - } - start_ = value; - - } - /** - * optional .rpc.BlockID start = 1; - */ - private void setStart( - rpc.Service.BlockID.Builder builderForValue) { - start_ = builderForValue.build(); - - } - /** - * optional .rpc.BlockID start = 1; - */ - private void mergeStart(rpc.Service.BlockID value) { - if (start_ != null && - start_ != rpc.Service.BlockID.getDefaultInstance()) { - start_ = - rpc.Service.BlockID.newBuilder(start_).mergeFrom(value).buildPartial(); - } else { - start_ = value; - } - - } - /** - * optional .rpc.BlockID start = 1; - */ - private void clearStart() { start_ = null; - - } - - public static final int END_FIELD_NUMBER = 2; - private rpc.Service.BlockID end_; - /** - * optional .rpc.BlockID end = 2; - */ - public boolean hasEnd() { - return end_ != null; - } - /** - * optional .rpc.BlockID end = 2; - */ - public rpc.Service.BlockID getEnd() { - return end_ == null ? rpc.Service.BlockID.getDefaultInstance() : end_; - } - /** - * optional .rpc.BlockID end = 2; - */ - private void setEnd(rpc.Service.BlockID value) { - if (value == null) { - throw new NullPointerException(); - } - end_ = value; - - } - /** - * optional .rpc.BlockID end = 2; - */ - private void setEnd( - rpc.Service.BlockID.Builder builderForValue) { - end_ = builderForValue.build(); - - } - /** - * optional .rpc.BlockID end = 2; - */ - private void mergeEnd(rpc.Service.BlockID value) { - if (end_ != null && - end_ != rpc.Service.BlockID.getDefaultInstance()) { - end_ = - rpc.Service.BlockID.newBuilder(end_).mergeFrom(value).buildPartial(); - } else { - end_ = value; - } - - } - /** - * optional .rpc.BlockID end = 2; - */ - private void clearEnd() { end_ = null; - - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (start_ != null) { - output.writeMessage(1, getStart()); - } - if (end_ != null) { - output.writeMessage(2, getEnd()); - } - } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (start_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getStart()); - } - if (end_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getEnd()); - } - memoizedSerializedSize = size; - return size; - } - - public static rpc.Service.BlockRange parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.BlockRange parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.BlockRange parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.BlockRange parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.BlockRange parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.BlockRange parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.BlockRange parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static rpc.Service.BlockRange parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.BlockRange parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.BlockRange parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(rpc.Service.BlockRange prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - /** - *
-     * BlockRange technically allows ranging from hash to hash etc but this is not
-     * currently intended for support, though there is no reason you couldn't do
-     * it. Further permutations are left as an exercise.
-     * 
- * - * Protobuf type {@code rpc.BlockRange} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - rpc.Service.BlockRange, Builder> implements - // @@protoc_insertion_point(builder_implements:rpc.BlockRange) - rpc.Service.BlockRangeOrBuilder { - // Construct using rpc.Service.BlockRange.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional .rpc.BlockID start = 1; - */ - public boolean hasStart() { - return instance.hasStart(); - } - /** - * optional .rpc.BlockID start = 1; - */ - public rpc.Service.BlockID getStart() { - return instance.getStart(); - } - /** - * optional .rpc.BlockID start = 1; - */ - public Builder setStart(rpc.Service.BlockID value) { - copyOnWrite(); - instance.setStart(value); - return this; - } - /** - * optional .rpc.BlockID start = 1; - */ - public Builder setStart( - rpc.Service.BlockID.Builder builderForValue) { - copyOnWrite(); - instance.setStart(builderForValue); - return this; - } - /** - * optional .rpc.BlockID start = 1; - */ - public Builder mergeStart(rpc.Service.BlockID value) { - copyOnWrite(); - instance.mergeStart(value); - return this; - } - /** - * optional .rpc.BlockID start = 1; - */ - public Builder clearStart() { copyOnWrite(); - instance.clearStart(); - return this; - } - - /** - * optional .rpc.BlockID end = 2; - */ - public boolean hasEnd() { - return instance.hasEnd(); - } - /** - * optional .rpc.BlockID end = 2; - */ - public rpc.Service.BlockID getEnd() { - return instance.getEnd(); - } - /** - * optional .rpc.BlockID end = 2; - */ - public Builder setEnd(rpc.Service.BlockID value) { - copyOnWrite(); - instance.setEnd(value); - return this; - } - /** - * optional .rpc.BlockID end = 2; - */ - public Builder setEnd( - rpc.Service.BlockID.Builder builderForValue) { - copyOnWrite(); - instance.setEnd(builderForValue); - return this; - } - /** - * optional .rpc.BlockID end = 2; - */ - public Builder mergeEnd(rpc.Service.BlockID value) { - copyOnWrite(); - instance.mergeEnd(value); - return this; - } - /** - * optional .rpc.BlockID end = 2; - */ - public Builder clearEnd() { copyOnWrite(); - instance.clearEnd(); - return this; - } - - // @@protoc_insertion_point(builder_scope:rpc.BlockRange) - } - protected final Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - Object arg0, Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new rpc.Service.BlockRange(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - return null; - } - case NEW_BUILDER: { - return new Builder(); - } - case VISIT: { - Visitor visitor = (Visitor) arg0; - rpc.Service.BlockRange other = (rpc.Service.BlockRange) arg1; - start_ = visitor.visitMessage(start_, other.start_); - end_ = visitor.visitMessage(end_, other.end_); - if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor - .INSTANCE) { - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - rpc.Service.BlockID.Builder subBuilder = null; - if (start_ != null) { - subBuilder = start_.toBuilder(); - } - start_ = input.readMessage(rpc.Service.BlockID.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(start_); - start_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - rpc.Service.BlockID.Builder subBuilder = null; - if (end_ != null) { - subBuilder = end_.toBuilder(); - } - end_ = input.readMessage(rpc.Service.BlockID.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(end_); - end_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } - } - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - if (PARSER == null) { synchronized (rpc.Service.BlockRange.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); - } - } - } - return PARSER; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:rpc.BlockRange) - private static final rpc.Service.BlockRange DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new BlockRange(); - DEFAULT_INSTANCE.makeImmutable(); - } - - public static rpc.Service.BlockRange getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface TxFilterOrBuilder extends - // @@protoc_insertion_point(interface_extends:rpc.TxFilter) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional .rpc.BlockID block = 1; - */ - boolean hasBlock(); - /** - * optional .rpc.BlockID block = 1; - */ - rpc.Service.BlockID getBlock(); - - /** - * optional uint64 index = 2; - */ - long getIndex(); - - /** - * optional bytes hash = 3; - */ - com.google.protobuf.ByteString getHash(); - } - /** - *
-   * A TxFilter contains the information needed to identify a particular
-   * transaction: either a block and an index, or a direct transaction hash.
-   * 
- * - * Protobuf type {@code rpc.TxFilter} - */ - public static final class TxFilter extends - com.google.protobuf.GeneratedMessageLite< - TxFilter, TxFilter.Builder> implements - // @@protoc_insertion_point(message_implements:rpc.TxFilter) - TxFilterOrBuilder { - private TxFilter() { - hash_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int BLOCK_FIELD_NUMBER = 1; - private rpc.Service.BlockID block_; - /** - * optional .rpc.BlockID block = 1; - */ - public boolean hasBlock() { - return block_ != null; - } - /** - * optional .rpc.BlockID block = 1; - */ - public rpc.Service.BlockID getBlock() { - return block_ == null ? rpc.Service.BlockID.getDefaultInstance() : block_; - } - /** - * optional .rpc.BlockID block = 1; - */ - private void setBlock(rpc.Service.BlockID value) { - if (value == null) { - throw new NullPointerException(); - } - block_ = value; - - } - /** - * optional .rpc.BlockID block = 1; - */ - private void setBlock( - rpc.Service.BlockID.Builder builderForValue) { - block_ = builderForValue.build(); - - } - /** - * optional .rpc.BlockID block = 1; - */ - private void mergeBlock(rpc.Service.BlockID value) { - if (block_ != null && - block_ != rpc.Service.BlockID.getDefaultInstance()) { - block_ = - rpc.Service.BlockID.newBuilder(block_).mergeFrom(value).buildPartial(); - } else { - block_ = value; - } - - } - /** - * optional .rpc.BlockID block = 1; - */ - private void clearBlock() { block_ = null; - - } - - public static final int INDEX_FIELD_NUMBER = 2; - private long index_; - /** - * optional uint64 index = 2; - */ - public long getIndex() { - return index_; - } - /** - * optional uint64 index = 2; - */ - private void setIndex(long value) { - - index_ = value; - } - /** - * optional uint64 index = 2; - */ - private void clearIndex() { - - index_ = 0L; - } - - public static final int HASH_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString hash_; - /** - * optional bytes hash = 3; - */ - public com.google.protobuf.ByteString getHash() { - return hash_; - } - /** - * optional bytes hash = 3; - */ - private void setHash(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - hash_ = value; - } - /** - * optional bytes hash = 3; - */ - private void clearHash() { - - hash_ = getDefaultInstance().getHash(); - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (block_ != null) { - output.writeMessage(1, getBlock()); - } - if (index_ != 0L) { - output.writeUInt64(2, index_); - } - if (!hash_.isEmpty()) { - output.writeBytes(3, hash_); - } - } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (block_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getBlock()); - } - if (index_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, index_); - } - if (!hash_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, hash_); - } - memoizedSerializedSize = size; - return size; - } - - public static rpc.Service.TxFilter parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.TxFilter parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.TxFilter parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.TxFilter parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.TxFilter parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.TxFilter parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.TxFilter parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static rpc.Service.TxFilter parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.TxFilter parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.TxFilter parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(rpc.Service.TxFilter prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - /** - *
-     * A TxFilter contains the information needed to identify a particular
-     * transaction: either a block and an index, or a direct transaction hash.
-     * 
- * - * Protobuf type {@code rpc.TxFilter} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - rpc.Service.TxFilter, Builder> implements - // @@protoc_insertion_point(builder_implements:rpc.TxFilter) - rpc.Service.TxFilterOrBuilder { - // Construct using rpc.Service.TxFilter.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional .rpc.BlockID block = 1; - */ - public boolean hasBlock() { - return instance.hasBlock(); - } - /** - * optional .rpc.BlockID block = 1; - */ - public rpc.Service.BlockID getBlock() { - return instance.getBlock(); - } - /** - * optional .rpc.BlockID block = 1; - */ - public Builder setBlock(rpc.Service.BlockID value) { - copyOnWrite(); - instance.setBlock(value); - return this; - } - /** - * optional .rpc.BlockID block = 1; - */ - public Builder setBlock( - rpc.Service.BlockID.Builder builderForValue) { - copyOnWrite(); - instance.setBlock(builderForValue); - return this; - } - /** - * optional .rpc.BlockID block = 1; - */ - public Builder mergeBlock(rpc.Service.BlockID value) { - copyOnWrite(); - instance.mergeBlock(value); - return this; - } - /** - * optional .rpc.BlockID block = 1; - */ - public Builder clearBlock() { copyOnWrite(); - instance.clearBlock(); - return this; - } - - /** - * optional uint64 index = 2; - */ - public long getIndex() { - return instance.getIndex(); - } - /** - * optional uint64 index = 2; - */ - public Builder setIndex(long value) { - copyOnWrite(); - instance.setIndex(value); - return this; - } - /** - * optional uint64 index = 2; - */ - public Builder clearIndex() { - copyOnWrite(); - instance.clearIndex(); - return this; - } - - /** - * optional bytes hash = 3; - */ - public com.google.protobuf.ByteString getHash() { - return instance.getHash(); - } - /** - * optional bytes hash = 3; - */ - public Builder setHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setHash(value); - return this; - } - /** - * optional bytes hash = 3; - */ - public Builder clearHash() { - copyOnWrite(); - instance.clearHash(); - return this; - } - - // @@protoc_insertion_point(builder_scope:rpc.TxFilter) - } - protected final Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - Object arg0, Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new rpc.Service.TxFilter(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - return null; - } - case NEW_BUILDER: { - return new Builder(); - } - case VISIT: { - Visitor visitor = (Visitor) arg0; - rpc.Service.TxFilter other = (rpc.Service.TxFilter) arg1; - block_ = visitor.visitMessage(block_, other.block_); - index_ = visitor.visitLong(index_ != 0L, index_, - other.index_ != 0L, other.index_); - hash_ = visitor.visitByteString(hash_ != com.google.protobuf.ByteString.EMPTY, hash_, - other.hash_ != com.google.protobuf.ByteString.EMPTY, other.hash_); - if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor - .INSTANCE) { - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - rpc.Service.BlockID.Builder subBuilder = null; - if (block_ != null) { - subBuilder = block_.toBuilder(); - } - block_ = input.readMessage(rpc.Service.BlockID.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(block_); - block_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { - - index_ = input.readUInt64(); - break; - } - case 26: { - - hash_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } - } - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - if (PARSER == null) { synchronized (rpc.Service.TxFilter.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); - } - } - } - return PARSER; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:rpc.TxFilter) - private static final rpc.Service.TxFilter DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new TxFilter(); - DEFAULT_INSTANCE.makeImmutable(); - } - - public static rpc.Service.TxFilter getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface RawTransactionOrBuilder extends - // @@protoc_insertion_point(interface_extends:rpc.RawTransaction) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional bytes data = 1; - */ - com.google.protobuf.ByteString getData(); - } - /** - *
-   * RawTransaction contains the complete transaction data.
-   * 
- * - * Protobuf type {@code rpc.RawTransaction} - */ - public static final class RawTransaction extends - com.google.protobuf.GeneratedMessageLite< - RawTransaction, RawTransaction.Builder> implements - // @@protoc_insertion_point(message_implements:rpc.RawTransaction) - RawTransactionOrBuilder { - private RawTransaction() { - data_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int DATA_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString data_; - /** - * optional bytes data = 1; - */ - public com.google.protobuf.ByteString getData() { - return data_; - } - /** - * optional bytes data = 1; - */ - private void setData(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - data_ = value; - } - /** - * optional bytes data = 1; - */ - private void clearData() { - - data_ = getDefaultInstance().getData(); - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!data_.isEmpty()) { - output.writeBytes(1, data_); - } - } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (!data_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, data_); - } - memoizedSerializedSize = size; - return size; - } - - public static rpc.Service.RawTransaction parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.RawTransaction parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.RawTransaction parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.RawTransaction parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.RawTransaction parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.RawTransaction parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.RawTransaction parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static rpc.Service.RawTransaction parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.RawTransaction parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.RawTransaction parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(rpc.Service.RawTransaction prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - /** - *
-     * RawTransaction contains the complete transaction data.
-     * 
- * - * Protobuf type {@code rpc.RawTransaction} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - rpc.Service.RawTransaction, Builder> implements - // @@protoc_insertion_point(builder_implements:rpc.RawTransaction) - rpc.Service.RawTransactionOrBuilder { - // Construct using rpc.Service.RawTransaction.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional bytes data = 1; - */ - public com.google.protobuf.ByteString getData() { - return instance.getData(); - } - /** - * optional bytes data = 1; - */ - public Builder setData(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setData(value); - return this; - } - /** - * optional bytes data = 1; - */ - public Builder clearData() { - copyOnWrite(); - instance.clearData(); - return this; - } - - // @@protoc_insertion_point(builder_scope:rpc.RawTransaction) - } - protected final Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - Object arg0, Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new rpc.Service.RawTransaction(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - return null; - } - case NEW_BUILDER: { - return new Builder(); - } - case VISIT: { - Visitor visitor = (Visitor) arg0; - rpc.Service.RawTransaction other = (rpc.Service.RawTransaction) arg1; - data_ = visitor.visitByteString(data_ != com.google.protobuf.ByteString.EMPTY, data_, - other.data_ != com.google.protobuf.ByteString.EMPTY, other.data_); - if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor - .INSTANCE) { - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - - data_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } - } - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - if (PARSER == null) { synchronized (rpc.Service.RawTransaction.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); - } - } - } - return PARSER; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:rpc.RawTransaction) - private static final rpc.Service.RawTransaction DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new RawTransaction(); - DEFAULT_INSTANCE.makeImmutable(); - } - - public static rpc.Service.RawTransaction getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SendResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:rpc.SendResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional int32 errorCode = 1; - */ - int getErrorCode(); - - /** - * optional string errorMessage = 2; - */ - java.lang.String getErrorMessage(); - /** - * optional string errorMessage = 2; - */ - com.google.protobuf.ByteString - getErrorMessageBytes(); - } - /** - * Protobuf type {@code rpc.SendResponse} - */ - public static final class SendResponse extends - com.google.protobuf.GeneratedMessageLite< - SendResponse, SendResponse.Builder> implements - // @@protoc_insertion_point(message_implements:rpc.SendResponse) - SendResponseOrBuilder { - private SendResponse() { - errorMessage_ = ""; - } - public static final int ERRORCODE_FIELD_NUMBER = 1; - private int errorCode_; - /** - * optional int32 errorCode = 1; - */ - public int getErrorCode() { - return errorCode_; - } - /** - * optional int32 errorCode = 1; - */ - private void setErrorCode(int value) { - - errorCode_ = value; - } - /** - * optional int32 errorCode = 1; - */ - private void clearErrorCode() { - - errorCode_ = 0; - } - - public static final int ERRORMESSAGE_FIELD_NUMBER = 2; - private java.lang.String errorMessage_; - /** - * optional string errorMessage = 2; - */ - public java.lang.String getErrorMessage() { - return errorMessage_; - } - /** - * optional string errorMessage = 2; - */ - public com.google.protobuf.ByteString - getErrorMessageBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(errorMessage_); - } - /** - * optional string errorMessage = 2; - */ - private void setErrorMessage( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - errorMessage_ = value; - } - /** - * optional string errorMessage = 2; - */ - private void clearErrorMessage() { - - errorMessage_ = getDefaultInstance().getErrorMessage(); - } - /** - * optional string errorMessage = 2; - */ - private void setErrorMessageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - errorMessage_ = value.toStringUtf8(); - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (errorCode_ != 0) { - output.writeInt32(1, errorCode_); - } - if (!errorMessage_.isEmpty()) { - output.writeString(2, getErrorMessage()); - } - } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (errorCode_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, errorCode_); - } - if (!errorMessage_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(2, getErrorMessage()); - } - memoizedSerializedSize = size; - return size; - } - - public static rpc.Service.SendResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.SendResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.SendResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.SendResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.SendResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.SendResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.SendResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static rpc.Service.SendResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.SendResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.SendResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(rpc.Service.SendResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - /** - * Protobuf type {@code rpc.SendResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - rpc.Service.SendResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:rpc.SendResponse) - rpc.Service.SendResponseOrBuilder { - // Construct using rpc.Service.SendResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional int32 errorCode = 1; - */ - public int getErrorCode() { - return instance.getErrorCode(); - } - /** - * optional int32 errorCode = 1; - */ - public Builder setErrorCode(int value) { - copyOnWrite(); - instance.setErrorCode(value); - return this; - } - /** - * optional int32 errorCode = 1; - */ - public Builder clearErrorCode() { - copyOnWrite(); - instance.clearErrorCode(); - return this; - } - - /** - * optional string errorMessage = 2; - */ - public java.lang.String getErrorMessage() { - return instance.getErrorMessage(); - } - /** - * optional string errorMessage = 2; - */ - public com.google.protobuf.ByteString - getErrorMessageBytes() { - return instance.getErrorMessageBytes(); - } - /** - * optional string errorMessage = 2; - */ - public Builder setErrorMessage( - java.lang.String value) { - copyOnWrite(); - instance.setErrorMessage(value); - return this; - } - /** - * optional string errorMessage = 2; - */ - public Builder clearErrorMessage() { - copyOnWrite(); - instance.clearErrorMessage(); - return this; - } - /** - * optional string errorMessage = 2; - */ - public Builder setErrorMessageBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setErrorMessageBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:rpc.SendResponse) - } - protected final Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - Object arg0, Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new rpc.Service.SendResponse(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - return null; - } - case NEW_BUILDER: { - return new Builder(); - } - case VISIT: { - Visitor visitor = (Visitor) arg0; - rpc.Service.SendResponse other = (rpc.Service.SendResponse) arg1; - errorCode_ = visitor.visitInt(errorCode_ != 0, errorCode_, - other.errorCode_ != 0, other.errorCode_); - errorMessage_ = visitor.visitString(!errorMessage_.isEmpty(), errorMessage_, - !other.errorMessage_.isEmpty(), other.errorMessage_); - if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor - .INSTANCE) { - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - errorCode_ = input.readInt32(); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - errorMessage_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } - } - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - if (PARSER == null) { synchronized (rpc.Service.SendResponse.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); - } - } - } - return PARSER; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:rpc.SendResponse) - private static final rpc.Service.SendResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new SendResponse(); - DEFAULT_INSTANCE.makeImmutable(); - } - - public static rpc.Service.SendResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface ChainSpecOrBuilder extends - // @@protoc_insertion_point(interface_extends:rpc.ChainSpec) - com.google.protobuf.MessageLiteOrBuilder { - } - /** - *
-   * Empty placeholder. Someday we may want to specify e.g. a particular chain fork.
-   * 
- * - * Protobuf type {@code rpc.ChainSpec} - */ - public static final class ChainSpec extends - com.google.protobuf.GeneratedMessageLite< - ChainSpec, ChainSpec.Builder> implements - // @@protoc_insertion_point(message_implements:rpc.ChainSpec) - ChainSpecOrBuilder { - private ChainSpec() { - } - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - memoizedSerializedSize = size; - return size; - } - - public static rpc.Service.ChainSpec parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.ChainSpec parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.ChainSpec parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static rpc.Service.ChainSpec parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static rpc.Service.ChainSpec parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.ChainSpec parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.ChainSpec parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static rpc.Service.ChainSpec parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static rpc.Service.ChainSpec parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static rpc.Service.ChainSpec parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(rpc.Service.ChainSpec prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - /** - *
-     * Empty placeholder. Someday we may want to specify e.g. a particular chain fork.
-     * 
- * - * Protobuf type {@code rpc.ChainSpec} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - rpc.Service.ChainSpec, Builder> implements - // @@protoc_insertion_point(builder_implements:rpc.ChainSpec) - rpc.Service.ChainSpecOrBuilder { - // Construct using rpc.Service.ChainSpec.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - // @@protoc_insertion_point(builder_scope:rpc.ChainSpec) - } - protected final Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - Object arg0, Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new rpc.Service.ChainSpec(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - return null; - } - case NEW_BUILDER: { - return new Builder(); - } - case VISIT: { - Visitor visitor = (Visitor) arg0; - rpc.Service.ChainSpec other = (rpc.Service.ChainSpec) arg1; - if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor - .INSTANCE) { - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } - } - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - if (PARSER == null) { synchronized (rpc.Service.ChainSpec.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); - } - } - } - return PARSER; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:rpc.ChainSpec) - private static final rpc.Service.ChainSpec DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new ChainSpec(); - DEFAULT_INSTANCE.makeImmutable(); - } - - public static rpc.Service.ChainSpec getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - - static { - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/src/main/java/cash/z/wallet/sdk/data/CompactBlockDownloader.kt b/src/main/java/cash/z/wallet/sdk/data/CompactBlockDownloader.kt index d9e701ed..d1b99437 100644 --- a/src/main/java/cash/z/wallet/sdk/data/CompactBlockDownloader.kt +++ b/src/main/java/cash/z/wallet/sdk/data/CompactBlockDownloader.kt @@ -2,17 +2,15 @@ package cash.z.wallet.sdk.data import cash.z.wallet.sdk.ext.debug import cash.z.wallet.sdk.ext.toBlockRange -import io.grpc.ManagedChannel +import cash.z.wallet.sdk.rpc.CompactFormats.CompactBlock +import cash.z.wallet.sdk.rpc.CompactTxStreamerGrpc +import cash.z.wallet.sdk.rpc.CompactTxStreamerGrpc.CompactTxStreamerBlockingStub +import cash.z.wallet.sdk.rpc.Service import io.grpc.ManagedChannelBuilder import kotlinx.coroutines.* import kotlinx.coroutines.Dispatchers.IO -import kotlinx.coroutines.NonCancellable.isActive import kotlinx.coroutines.channels.BroadcastChannel import kotlinx.coroutines.channels.ReceiveChannel -import rpc.CompactFormats.CompactBlock -import rpc.CompactTxStreamerGrpc -import rpc.CompactTxStreamerGrpc.CompactTxStreamerBlockingStub -import rpc.Service import java.io.Closeable /** diff --git a/src/main/java/cash/z/wallet/sdk/data/Synchronizer.kt b/src/main/java/cash/z/wallet/sdk/data/Synchronizer.kt index 94fc21a8..8d5f57ef 100644 --- a/src/main/java/cash/z/wallet/sdk/data/Synchronizer.kt +++ b/src/main/java/cash/z/wallet/sdk/data/Synchronizer.kt @@ -10,7 +10,7 @@ import cash.z.wallet.sdk.jni.JniConverter import kotlinx.coroutines.* import kotlinx.coroutines.channels.ConflatedBroadcastChannel import kotlinx.coroutines.channels.ReceiveChannel -import rpc.CompactFormats +import cash.z.wallet.sdk.rpc.CompactFormats /** * Downloads compact blocks to the database and then scans them for transactions diff --git a/src/main/java/cash/z/wallet/sdk/ext/WalletService.kt b/src/main/java/cash/z/wallet/sdk/ext/WalletService.kt index 634ce74b..31fc90dd 100644 --- a/src/main/java/cash/z/wallet/sdk/ext/WalletService.kt +++ b/src/main/java/cash/z/wallet/sdk/ext/WalletService.kt @@ -1,6 +1,6 @@ package cash.z.wallet.sdk.ext -import rpc.Service +import cash.z.wallet.sdk.rpc.Service inline fun Long.toBlockHeight(): Service.BlockID = Service.BlockID.newBuilder().setHeight(this).build() inline fun LongRange.toBlockRange(): Service.BlockRange = diff --git a/src/main/java/cash/z/wallet/sdk/jni/JniConverter.kt b/src/main/java/cash/z/wallet/sdk/jni/JniConverter.kt index 26969308..b9b0ef55 100644 --- a/src/main/java/cash/z/wallet/sdk/jni/JniConverter.kt +++ b/src/main/java/cash/z/wallet/sdk/jni/JniConverter.kt @@ -35,7 +35,8 @@ class JniConverter { value: Long, memo: String, spendParams: String, - outputParams: String): Long + outputParams: String + ): Long external fun initLogs() diff --git a/src/main/proto/compact_formats.proto b/src/main/proto/compact_formats.proto index 07bd3450..49f43b8e 100644 --- a/src/main/proto/compact_formats.proto +++ b/src/main/proto/compact_formats.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package cash.z.wallet.sdk.rpc; option go_package = "walletrpc"; -package rpc; // Remember that proto3 fields are all optional. A field that is not present will be set to its zero value. // bytes fields of hashes are in canonical little-endian format. @@ -45,4 +44,4 @@ message CompactOutput { bytes cmu = 1; bytes epk = 2; bytes ciphertext = 3; -} +} \ No newline at end of file diff --git a/src/main/proto/service.proto b/src/main/proto/service.proto index d1948467..454cc0bb 100644 --- a/src/main/proto/service.proto +++ b/src/main/proto/service.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package cash.z.wallet.sdk.rpc; option go_package = "walletrpc"; -package rpc; import "compact_formats.proto"; @@ -47,4 +46,4 @@ service CompactTxStreamer { rpc GetBlockRange(BlockRange) returns (stream CompactBlock) {} rpc GetTransaction(TxFilter) returns (RawTransaction) {} rpc SendTransaction(RawTransaction) returns (SendResponse) {} -} +} \ No newline at end of file