Update proto

This commit is contained in:
Xiaomin Zhu 2020-03-07 17:31:38 +08:00
parent 4e3edab38d
commit d4c57607e2
6 changed files with 241 additions and 242 deletions

View File

@ -21,7 +21,7 @@ import java.util.logging.Logger;
/** /**
* 事务账本客户端 * 事务账本客户端
* *
* <p>如有更灵活的需求可直接使用{@link bdledger.api.grpc.ledger.TransactionLedgerGrpc} * <p>如有更灵活的需求可直接使用{@link bdledger.api.grpc.ledger.LedgerGrpc}
* *
* @author nex * @author nex
* @see <a href="#">事务账本API</a> * @see <a href="#">事务账本API</a>
@ -33,8 +33,8 @@ public class Client {
private final ManagedChannel channel; private final ManagedChannel channel;
private final NodeGrpc.NodeFutureStub nodeFutureStub; private final NodeGrpc.NodeFutureStub nodeFutureStub;
private final NodeGrpc.NodeBlockingStub nodeBlockingStub; private final NodeGrpc.NodeBlockingStub nodeBlockingStub;
private final TransactionLedgerGrpc.TransactionLedgerFutureStub ledgerFutureStub; private final LedgerGrpc.LedgerFutureStub ledgerFutureStub;
private final TransactionLedgerGrpc.TransactionLedgerBlockingStub ledgerBlockingStub; private final LedgerGrpc.LedgerBlockingStub ledgerBlockingStub;
private final QueryGrpc.QueryFutureStub queryFutureStub; private final QueryGrpc.QueryFutureStub queryFutureStub;
private final QueryGrpc.QueryBlockingStub queryBlockingStub; private final QueryGrpc.QueryBlockingStub queryBlockingStub;
@ -52,8 +52,8 @@ public class Client {
channel = channelBuilder.build(); channel = channelBuilder.build();
nodeFutureStub = NodeGrpc.newFutureStub(channel); nodeFutureStub = NodeGrpc.newFutureStub(channel);
nodeBlockingStub = NodeGrpc.newBlockingStub(channel); nodeBlockingStub = NodeGrpc.newBlockingStub(channel);
ledgerFutureStub = TransactionLedgerGrpc.newFutureStub(channel); ledgerFutureStub = LedgerGrpc.newFutureStub(channel);
ledgerBlockingStub = TransactionLedgerGrpc.newBlockingStub(channel); ledgerBlockingStub = LedgerGrpc.newBlockingStub(channel);
queryFutureStub = QueryGrpc.newFutureStub(channel); queryFutureStub = QueryGrpc.newFutureStub(channel);
queryBlockingStub = QueryGrpc.newBlockingStub(channel); queryBlockingStub = QueryGrpc.newBlockingStub(channel);
} }

View File

@ -55,17 +55,12 @@ private static final long serialVersionUID = 0L;
case 0: case 0:
done = true; done = true;
break; break;
case 8: { case 10: {
index_ = input.readUInt64();
break;
}
case 18: {
hash_ = input.readBytes(); hash_ = input.readBytes();
break; break;
} }
case 26: { case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) { if (!((mutable_bitField0_ & 0x00000001) != 0)) {
parentHashes_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); parentHashes_ = new java.util.ArrayList<com.google.protobuf.ByteString>();
mutable_bitField0_ |= 0x00000001; mutable_bitField0_ |= 0x00000001;
@ -73,7 +68,7 @@ private static final long serialVersionUID = 0L;
parentHashes_.add(input.readBytes()); parentHashes_.add(input.readBytes());
break; break;
} }
case 34: { case 26: {
if (!((mutable_bitField0_ & 0x00000002) != 0)) { if (!((mutable_bitField0_ & 0x00000002) != 0)) {
witnesses_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); witnesses_ = new java.util.ArrayList<com.google.protobuf.ByteString>();
mutable_bitField0_ |= 0x00000002; mutable_bitField0_ |= 0x00000002;
@ -81,16 +76,21 @@ private static final long serialVersionUID = 0L;
witnesses_.add(input.readBytes()); witnesses_.add(input.readBytes());
break; break;
} }
case 40: { case 32: {
timestamp_ = input.readInt64(); timestamp_ = input.readInt64();
break; break;
} }
case 48: { case 40: {
size_ = input.readUInt64(); size_ = input.readUInt64();
break; break;
} }
case 48: {
transactionCount_ = input.readUInt32();
break;
}
case 58: { case 58: {
transactionsRoot_ = input.readBytes(); transactionsRoot_ = input.readBytes();
@ -157,42 +157,28 @@ private static final long serialVersionUID = 0L;
bdledger.api.grpc.common.Block.class, bdledger.api.grpc.common.Block.Builder.class); bdledger.api.grpc.common.Block.class, bdledger.api.grpc.common.Block.Builder.class);
} }
public static final int INDEX_FIELD_NUMBER = 1; public static final int HASH_FIELD_NUMBER = 1;
private long index_;
/**
* <pre>
* 事务链本地区块索引当区块处于待确认状态时为`null`
* </pre>
*
* <code>uint64 index = 1;</code>
* @return The index.
*/
public long getIndex() {
return index_;
}
public static final int HASH_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString hash_; private com.google.protobuf.ByteString hash_;
/** /**
* <pre> * <pre>
* 区块的哈希当区块处于待确认状态时为`null` * 区块的哈希当区块处于待确认状态时为`null`
* </pre> * </pre>
* *
* <code>bytes hash = 2;</code> * <code>bytes hash = 1;</code>
* @return The hash. * @return The hash.
*/ */
public com.google.protobuf.ByteString getHash() { public com.google.protobuf.ByteString getHash() {
return hash_; return hash_;
} }
public static final int PARENT_HASHES_FIELD_NUMBER = 3; public static final int PARENT_HASHES_FIELD_NUMBER = 2;
private java.util.List<com.google.protobuf.ByteString> parentHashes_; private java.util.List<com.google.protobuf.ByteString> parentHashes_;
/** /**
* <pre> * <pre>
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @return A list containing the parentHashes. * @return A list containing the parentHashes.
*/ */
public java.util.List<com.google.protobuf.ByteString> public java.util.List<com.google.protobuf.ByteString>
@ -204,7 +190,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @return The count of parentHashes. * @return The count of parentHashes.
*/ */
public int getParentHashesCount() { public int getParentHashesCount() {
@ -215,7 +201,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @param index The index of the element to return. * @param index The index of the element to return.
* @return The parentHashes at the given index. * @return The parentHashes at the given index.
*/ */
@ -223,14 +209,14 @@ private static final long serialVersionUID = 0L;
return parentHashes_.get(index); return parentHashes_.get(index);
} }
public static final int WITNESSES_FIELD_NUMBER = 4; public static final int WITNESSES_FIELD_NUMBER = 3;
private java.util.List<com.google.protobuf.ByteString> witnesses_; private java.util.List<com.google.protobuf.ByteString> witnesses_;
/** /**
* <pre> * <pre>
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @return A list containing the witnesses. * @return A list containing the witnesses.
*/ */
public java.util.List<com.google.protobuf.ByteString> public java.util.List<com.google.protobuf.ByteString>
@ -242,7 +228,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @return The count of witnesses. * @return The count of witnesses.
*/ */
public int getWitnessesCount() { public int getWitnessesCount() {
@ -253,7 +239,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @param index The index of the element to return. * @param index The index of the element to return.
* @return The witnesses at the given index. * @return The witnesses at the given index.
*/ */
@ -261,39 +247,53 @@ private static final long serialVersionUID = 0L;
return witnesses_.get(index); return witnesses_.get(index);
} }
public static final int TIMESTAMP_FIELD_NUMBER = 5; public static final int TIMESTAMP_FIELD_NUMBER = 4;
private long timestamp_; private long timestamp_;
/** /**
* <pre> * <pre>
* 区块产生时的 UNIX 时间戳单位为秒 * 区块产生时的 UNIX 时间戳单位为秒
* </pre> * </pre>
* *
* <code>int64 timestamp = 5;</code> * <code>int64 timestamp = 4;</code>
* @return The timestamp. * @return The timestamp.
*/ */
public long getTimestamp() { public long getTimestamp() {
return timestamp_; return timestamp_;
} }
public static final int SIZE_FIELD_NUMBER = 6; public static final int SIZE_FIELD_NUMBER = 5;
private long size_; private long size_;
/** /**
* <pre> * <pre>
* 区块大小的字节数 * 区块大小的字节数
* </pre> * </pre>
* *
* <code>uint64 size = 6;</code> * <code>uint64 size = 5;</code>
* @return The size. * @return The size.
*/ */
public long getSize() { public long getSize() {
return size_; return size_;
} }
public static final int TRANSACTION_COUNT_FIELD_NUMBER = 6;
private int transactionCount_;
/**
* <pre>
* 区块包含的事务数量
* </pre>
*
* <code>uint32 transaction_count = 6;</code>
* @return The transactionCount.
*/
public int getTransactionCount() {
return transactionCount_;
}
public static final int TRANSACTIONS_ROOT_FIELD_NUMBER = 7; public static final int TRANSACTIONS_ROOT_FIELD_NUMBER = 7;
private com.google.protobuf.ByteString transactionsRoot_; private com.google.protobuf.ByteString transactionsRoot_;
/** /**
* <pre> * <pre>
* 区块的事务树根 * 区块的事务默克尔树根
* </pre> * </pre>
* *
* <code>bytes transactions_root = 7;</code> * <code>bytes transactions_root = 7;</code>
@ -410,23 +410,23 @@ private static final long serialVersionUID = 0L;
@java.lang.Override @java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException { throws java.io.IOException {
if (index_ != 0L) {
output.writeUInt64(1, index_);
}
if (!hash_.isEmpty()) { if (!hash_.isEmpty()) {
output.writeBytes(2, hash_); output.writeBytes(1, hash_);
} }
for (int i = 0; i < parentHashes_.size(); i++) { for (int i = 0; i < parentHashes_.size(); i++) {
output.writeBytes(3, parentHashes_.get(i)); output.writeBytes(2, parentHashes_.get(i));
} }
for (int i = 0; i < witnesses_.size(); i++) { for (int i = 0; i < witnesses_.size(); i++) {
output.writeBytes(4, witnesses_.get(i)); output.writeBytes(3, witnesses_.get(i));
} }
if (timestamp_ != 0L) { if (timestamp_ != 0L) {
output.writeInt64(5, timestamp_); output.writeInt64(4, timestamp_);
} }
if (size_ != 0L) { if (size_ != 0L) {
output.writeUInt64(6, size_); output.writeUInt64(5, size_);
}
if (transactionCount_ != 0) {
output.writeUInt32(6, transactionCount_);
} }
if (!transactionsRoot_.isEmpty()) { if (!transactionsRoot_.isEmpty()) {
output.writeBytes(7, transactionsRoot_); output.writeBytes(7, transactionsRoot_);
@ -446,13 +446,9 @@ private static final long serialVersionUID = 0L;
if (size != -1) return size; if (size != -1) return size;
size = 0; size = 0;
if (index_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(1, index_);
}
if (!hash_.isEmpty()) { if (!hash_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, hash_); .computeBytesSize(1, hash_);
} }
{ {
int dataSize = 0; int dataSize = 0;
@ -474,11 +470,15 @@ private static final long serialVersionUID = 0L;
} }
if (timestamp_ != 0L) { if (timestamp_ != 0L) {
size += com.google.protobuf.CodedOutputStream size += com.google.protobuf.CodedOutputStream
.computeInt64Size(5, timestamp_); .computeInt64Size(4, timestamp_);
} }
if (size_ != 0L) { if (size_ != 0L) {
size += com.google.protobuf.CodedOutputStream size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(6, size_); .computeUInt64Size(5, size_);
}
if (transactionCount_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(6, transactionCount_);
} }
if (!transactionsRoot_.isEmpty()) { if (!transactionsRoot_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream size += com.google.protobuf.CodedOutputStream
@ -512,8 +512,6 @@ private static final long serialVersionUID = 0L;
} }
bdledger.api.grpc.common.Block other = (bdledger.api.grpc.common.Block) obj; bdledger.api.grpc.common.Block other = (bdledger.api.grpc.common.Block) obj;
if (getIndex()
!= other.getIndex()) return false;
if (!getHash() if (!getHash()
.equals(other.getHash())) return false; .equals(other.getHash())) return false;
if (!getParentHashesList() if (!getParentHashesList()
@ -524,6 +522,8 @@ private static final long serialVersionUID = 0L;
!= other.getTimestamp()) return false; != other.getTimestamp()) return false;
if (getSize() if (getSize()
!= other.getSize()) return false; != other.getSize()) return false;
if (getTransactionCount()
!= other.getTransactionCount()) return false;
if (!getTransactionsRoot() if (!getTransactionsRoot()
.equals(other.getTransactionsRoot())) return false; .equals(other.getTransactionsRoot())) return false;
if (!getTransactionsList() if (!getTransactionsList()
@ -541,9 +541,6 @@ private static final long serialVersionUID = 0L;
} }
int hash = 41; int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode(); hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + INDEX_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getIndex());
hash = (37 * hash) + HASH_FIELD_NUMBER; hash = (37 * hash) + HASH_FIELD_NUMBER;
hash = (53 * hash) + getHash().hashCode(); hash = (53 * hash) + getHash().hashCode();
if (getParentHashesCount() > 0) { if (getParentHashesCount() > 0) {
@ -560,6 +557,8 @@ private static final long serialVersionUID = 0L;
hash = (37 * hash) + SIZE_FIELD_NUMBER; hash = (37 * hash) + SIZE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong( hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getSize()); getSize());
hash = (37 * hash) + TRANSACTION_COUNT_FIELD_NUMBER;
hash = (53 * hash) + getTransactionCount();
hash = (37 * hash) + TRANSACTIONS_ROOT_FIELD_NUMBER; hash = (37 * hash) + TRANSACTIONS_ROOT_FIELD_NUMBER;
hash = (53 * hash) + getTransactionsRoot().hashCode(); hash = (53 * hash) + getTransactionsRoot().hashCode();
if (getTransactionsCount() > 0) { if (getTransactionsCount() > 0) {
@ -704,8 +703,6 @@ private static final long serialVersionUID = 0L;
@java.lang.Override @java.lang.Override
public Builder clear() { public Builder clear() {
super.clear(); super.clear();
index_ = 0L;
hash_ = com.google.protobuf.ByteString.EMPTY; hash_ = com.google.protobuf.ByteString.EMPTY;
parentHashes_ = java.util.Collections.emptyList(); parentHashes_ = java.util.Collections.emptyList();
@ -716,6 +713,8 @@ private static final long serialVersionUID = 0L;
size_ = 0L; size_ = 0L;
transactionCount_ = 0;
transactionsRoot_ = com.google.protobuf.ByteString.EMPTY; transactionsRoot_ = com.google.protobuf.ByteString.EMPTY;
if (transactionsBuilder_ == null) { if (transactionsBuilder_ == null) {
@ -753,7 +752,6 @@ private static final long serialVersionUID = 0L;
public bdledger.api.grpc.common.Block buildPartial() { public bdledger.api.grpc.common.Block buildPartial() {
bdledger.api.grpc.common.Block result = new bdledger.api.grpc.common.Block(this); bdledger.api.grpc.common.Block result = new bdledger.api.grpc.common.Block(this);
int from_bitField0_ = bitField0_; int from_bitField0_ = bitField0_;
result.index_ = index_;
result.hash_ = hash_; result.hash_ = hash_;
if (((bitField0_ & 0x00000001) != 0)) { if (((bitField0_ & 0x00000001) != 0)) {
parentHashes_ = java.util.Collections.unmodifiableList(parentHashes_); parentHashes_ = java.util.Collections.unmodifiableList(parentHashes_);
@ -767,6 +765,7 @@ private static final long serialVersionUID = 0L;
result.witnesses_ = witnesses_; result.witnesses_ = witnesses_;
result.timestamp_ = timestamp_; result.timestamp_ = timestamp_;
result.size_ = size_; result.size_ = size_;
result.transactionCount_ = transactionCount_;
result.transactionsRoot_ = transactionsRoot_; result.transactionsRoot_ = transactionsRoot_;
if (transactionsBuilder_ == null) { if (transactionsBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) { if (((bitField0_ & 0x00000004) != 0)) {
@ -830,9 +829,6 @@ private static final long serialVersionUID = 0L;
public Builder mergeFrom(bdledger.api.grpc.common.Block other) { public Builder mergeFrom(bdledger.api.grpc.common.Block other) {
if (other == bdledger.api.grpc.common.Block.getDefaultInstance()) return this; if (other == bdledger.api.grpc.common.Block.getDefaultInstance()) return this;
if (other.getIndex() != 0L) {
setIndex(other.getIndex());
}
if (other.getHash() != com.google.protobuf.ByteString.EMPTY) { if (other.getHash() != com.google.protobuf.ByteString.EMPTY) {
setHash(other.getHash()); setHash(other.getHash());
} }
@ -862,6 +858,9 @@ private static final long serialVersionUID = 0L;
if (other.getSize() != 0L) { if (other.getSize() != 0L) {
setSize(other.getSize()); setSize(other.getSize());
} }
if (other.getTransactionCount() != 0) {
setTransactionCount(other.getTransactionCount());
}
if (other.getTransactionsRoot() != com.google.protobuf.ByteString.EMPTY) { if (other.getTransactionsRoot() != com.google.protobuf.ByteString.EMPTY) {
setTransactionsRoot(other.getTransactionsRoot()); setTransactionsRoot(other.getTransactionsRoot());
} }
@ -931,55 +930,13 @@ private static final long serialVersionUID = 0L;
} }
private int bitField0_; private int bitField0_;
private long index_ ;
/**
* <pre>
* 事务链本地区块索引当区块处于待确认状态时为`null`
* </pre>
*
* <code>uint64 index = 1;</code>
* @return The index.
*/
public long getIndex() {
return index_;
}
/**
* <pre>
* 事务链本地区块索引当区块处于待确认状态时为`null`
* </pre>
*
* <code>uint64 index = 1;</code>
* @param value The index to set.
* @return This builder for chaining.
*/
public Builder setIndex(long value) {
index_ = value;
onChanged();
return this;
}
/**
* <pre>
* 事务链本地区块索引当区块处于待确认状态时为`null`
* </pre>
*
* <code>uint64 index = 1;</code>
* @return This builder for chaining.
*/
public Builder clearIndex() {
index_ = 0L;
onChanged();
return this;
}
private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY;
/** /**
* <pre> * <pre>
* 区块的哈希当区块处于待确认状态时为`null` * 区块的哈希当区块处于待确认状态时为`null`
* </pre> * </pre>
* *
* <code>bytes hash = 2;</code> * <code>bytes hash = 1;</code>
* @return The hash. * @return The hash.
*/ */
public com.google.protobuf.ByteString getHash() { public com.google.protobuf.ByteString getHash() {
@ -990,7 +947,7 @@ private static final long serialVersionUID = 0L;
* 区块的哈希当区块处于待确认状态时为`null` * 区块的哈希当区块处于待确认状态时为`null`
* </pre> * </pre>
* *
* <code>bytes hash = 2;</code> * <code>bytes hash = 1;</code>
* @param value The hash to set. * @param value The hash to set.
* @return This builder for chaining. * @return This builder for chaining.
*/ */
@ -1008,7 +965,7 @@ private static final long serialVersionUID = 0L;
* 区块的哈希当区块处于待确认状态时为`null` * 区块的哈希当区块处于待确认状态时为`null`
* </pre> * </pre>
* *
* <code>bytes hash = 2;</code> * <code>bytes hash = 1;</code>
* @return This builder for chaining. * @return This builder for chaining.
*/ */
public Builder clearHash() { public Builder clearHash() {
@ -1030,7 +987,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @return A list containing the parentHashes. * @return A list containing the parentHashes.
*/ */
public java.util.List<com.google.protobuf.ByteString> public java.util.List<com.google.protobuf.ByteString>
@ -1043,7 +1000,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @return The count of parentHashes. * @return The count of parentHashes.
*/ */
public int getParentHashesCount() { public int getParentHashesCount() {
@ -1054,7 +1011,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @param index The index of the element to return. * @param index The index of the element to return.
* @return The parentHashes at the given index. * @return The parentHashes at the given index.
*/ */
@ -1066,7 +1023,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @param index The index to set the value at. * @param index The index to set the value at.
* @param value The parentHashes to set. * @param value The parentHashes to set.
* @return This builder for chaining. * @return This builder for chaining.
@ -1086,7 +1043,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @param value The parentHashes to add. * @param value The parentHashes to add.
* @return This builder for chaining. * @return This builder for chaining.
*/ */
@ -1104,7 +1061,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @param values The parentHashes to add. * @param values The parentHashes to add.
* @return This builder for chaining. * @return This builder for chaining.
*/ */
@ -1121,7 +1078,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @return This builder for chaining. * @return This builder for chaining.
*/ */
public Builder clearParentHashes() { public Builder clearParentHashes() {
@ -1143,7 +1100,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @return A list containing the witnesses. * @return A list containing the witnesses.
*/ */
public java.util.List<com.google.protobuf.ByteString> public java.util.List<com.google.protobuf.ByteString>
@ -1156,7 +1113,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @return The count of witnesses. * @return The count of witnesses.
*/ */
public int getWitnessesCount() { public int getWitnessesCount() {
@ -1167,7 +1124,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @param index The index of the element to return. * @param index The index of the element to return.
* @return The witnesses at the given index. * @return The witnesses at the given index.
*/ */
@ -1179,7 +1136,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @param index The index to set the value at. * @param index The index to set the value at.
* @param value The witnesses to set. * @param value The witnesses to set.
* @return This builder for chaining. * @return This builder for chaining.
@ -1199,7 +1156,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @param value The witnesses to add. * @param value The witnesses to add.
* @return This builder for chaining. * @return This builder for chaining.
*/ */
@ -1217,7 +1174,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @param values The witnesses to add. * @param values The witnesses to add.
* @return This builder for chaining. * @return This builder for chaining.
*/ */
@ -1234,7 +1191,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @return This builder for chaining. * @return This builder for chaining.
*/ */
public Builder clearWitnesses() { public Builder clearWitnesses() {
@ -1250,7 +1207,7 @@ private static final long serialVersionUID = 0L;
* 区块产生时的 UNIX 时间戳单位为秒 * 区块产生时的 UNIX 时间戳单位为秒
* </pre> * </pre>
* *
* <code>int64 timestamp = 5;</code> * <code>int64 timestamp = 4;</code>
* @return The timestamp. * @return The timestamp.
*/ */
public long getTimestamp() { public long getTimestamp() {
@ -1261,7 +1218,7 @@ private static final long serialVersionUID = 0L;
* 区块产生时的 UNIX 时间戳单位为秒 * 区块产生时的 UNIX 时间戳单位为秒
* </pre> * </pre>
* *
* <code>int64 timestamp = 5;</code> * <code>int64 timestamp = 4;</code>
* @param value The timestamp to set. * @param value The timestamp to set.
* @return This builder for chaining. * @return This builder for chaining.
*/ */
@ -1276,7 +1233,7 @@ private static final long serialVersionUID = 0L;
* 区块产生时的 UNIX 时间戳单位为秒 * 区块产生时的 UNIX 时间戳单位为秒
* </pre> * </pre>
* *
* <code>int64 timestamp = 5;</code> * <code>int64 timestamp = 4;</code>
* @return This builder for chaining. * @return This builder for chaining.
*/ */
public Builder clearTimestamp() { public Builder clearTimestamp() {
@ -1292,7 +1249,7 @@ private static final long serialVersionUID = 0L;
* 区块大小的字节数 * 区块大小的字节数
* </pre> * </pre>
* *
* <code>uint64 size = 6;</code> * <code>uint64 size = 5;</code>
* @return The size. * @return The size.
*/ */
public long getSize() { public long getSize() {
@ -1303,7 +1260,7 @@ private static final long serialVersionUID = 0L;
* 区块大小的字节数 * 区块大小的字节数
* </pre> * </pre>
* *
* <code>uint64 size = 6;</code> * <code>uint64 size = 5;</code>
* @param value The size to set. * @param value The size to set.
* @return This builder for chaining. * @return This builder for chaining.
*/ */
@ -1318,7 +1275,7 @@ private static final long serialVersionUID = 0L;
* 区块大小的字节数 * 区块大小的字节数
* </pre> * </pre>
* *
* <code>uint64 size = 6;</code> * <code>uint64 size = 5;</code>
* @return This builder for chaining. * @return This builder for chaining.
*/ */
public Builder clearSize() { public Builder clearSize() {
@ -1328,10 +1285,52 @@ private static final long serialVersionUID = 0L;
return this; return this;
} }
private int transactionCount_ ;
/**
* <pre>
* 区块包含的事务数量
* </pre>
*
* <code>uint32 transaction_count = 6;</code>
* @return The transactionCount.
*/
public int getTransactionCount() {
return transactionCount_;
}
/**
* <pre>
* 区块包含的事务数量
* </pre>
*
* <code>uint32 transaction_count = 6;</code>
* @param value The transactionCount to set.
* @return This builder for chaining.
*/
public Builder setTransactionCount(int value) {
transactionCount_ = value;
onChanged();
return this;
}
/**
* <pre>
* 区块包含的事务数量
* </pre>
*
* <code>uint32 transaction_count = 6;</code>
* @return This builder for chaining.
*/
public Builder clearTransactionCount() {
transactionCount_ = 0;
onChanged();
return this;
}
private com.google.protobuf.ByteString transactionsRoot_ = com.google.protobuf.ByteString.EMPTY; private com.google.protobuf.ByteString transactionsRoot_ = com.google.protobuf.ByteString.EMPTY;
/** /**
* <pre> * <pre>
* 区块的事务树根 * 区块的事务默克尔树根
* </pre> * </pre>
* *
* <code>bytes transactions_root = 7;</code> * <code>bytes transactions_root = 7;</code>
@ -1342,7 +1341,7 @@ private static final long serialVersionUID = 0L;
} }
/** /**
* <pre> * <pre>
* 区块的事务树根 * 区块的事务默克尔树根
* </pre> * </pre>
* *
* <code>bytes transactions_root = 7;</code> * <code>bytes transactions_root = 7;</code>
@ -1360,7 +1359,7 @@ private static final long serialVersionUID = 0L;
} }
/** /**
* <pre> * <pre>
* 区块的事务树根 * 区块的事务默克尔树根
* </pre> * </pre>
* *
* <code>bytes transactions_root = 7;</code> * <code>bytes transactions_root = 7;</code>

View File

@ -7,22 +7,12 @@ public interface BlockOrBuilder extends
// @@protoc_insertion_point(interface_extends:bdledger.api.Block) // @@protoc_insertion_point(interface_extends:bdledger.api.Block)
com.google.protobuf.MessageOrBuilder { com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* 事务链本地区块索引当区块处于待确认状态时为`null`
* </pre>
*
* <code>uint64 index = 1;</code>
* @return The index.
*/
long getIndex();
/** /**
* <pre> * <pre>
* 区块的哈希当区块处于待确认状态时为`null` * 区块的哈希当区块处于待确认状态时为`null`
* </pre> * </pre>
* *
* <code>bytes hash = 2;</code> * <code>bytes hash = 1;</code>
* @return The hash. * @return The hash.
*/ */
com.google.protobuf.ByteString getHash(); com.google.protobuf.ByteString getHash();
@ -32,7 +22,7 @@ public interface BlockOrBuilder extends
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @return A list containing the parentHashes. * @return A list containing the parentHashes.
*/ */
java.util.List<com.google.protobuf.ByteString> getParentHashesList(); java.util.List<com.google.protobuf.ByteString> getParentHashesList();
@ -41,7 +31,7 @@ public interface BlockOrBuilder extends
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @return The count of parentHashes. * @return The count of parentHashes.
*/ */
int getParentHashesCount(); int getParentHashesCount();
@ -50,7 +40,7 @@ public interface BlockOrBuilder extends
* 父区块的哈希 * 父区块的哈希
* </pre> * </pre>
* *
* <code>repeated bytes parent_hashes = 3;</code> * <code>repeated bytes parent_hashes = 2;</code>
* @param index The index of the element to return. * @param index The index of the element to return.
* @return The parentHashes at the given index. * @return The parentHashes at the given index.
*/ */
@ -61,7 +51,7 @@ public interface BlockOrBuilder extends
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @return A list containing the witnesses. * @return A list containing the witnesses.
*/ */
java.util.List<com.google.protobuf.ByteString> getWitnessesList(); java.util.List<com.google.protobuf.ByteString> getWitnessesList();
@ -70,7 +60,7 @@ public interface BlockOrBuilder extends
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @return The count of witnesses. * @return The count of witnesses.
*/ */
int getWitnessesCount(); int getWitnessesCount();
@ -79,7 +69,7 @@ public interface BlockOrBuilder extends
* 见证者账户地址 * 见证者账户地址
* </pre> * </pre>
* *
* <code>repeated bytes witnesses = 4;</code> * <code>repeated bytes witnesses = 3;</code>
* @param index The index of the element to return. * @param index The index of the element to return.
* @return The witnesses at the given index. * @return The witnesses at the given index.
*/ */
@ -90,7 +80,7 @@ public interface BlockOrBuilder extends
* 区块产生时的 UNIX 时间戳单位为秒 * 区块产生时的 UNIX 时间戳单位为秒
* </pre> * </pre>
* *
* <code>int64 timestamp = 5;</code> * <code>int64 timestamp = 4;</code>
* @return The timestamp. * @return The timestamp.
*/ */
long getTimestamp(); long getTimestamp();
@ -100,14 +90,24 @@ public interface BlockOrBuilder extends
* 区块大小的字节数 * 区块大小的字节数
* </pre> * </pre>
* *
* <code>uint64 size = 6;</code> * <code>uint64 size = 5;</code>
* @return The size. * @return The size.
*/ */
long getSize(); long getSize();
/** /**
* <pre> * <pre>
* 区块的事务树根 * 区块包含的事务数量
* </pre>
*
* <code>uint32 transaction_count = 6;</code>
* @return The transactionCount.
*/
int getTransactionCount();
/**
* <pre>
* 区块的事务默克尔树根
* </pre> * </pre>
* *
* <code>bytes transactions_root = 7;</code> * <code>bytes transactions_root = 7;</code>

View File

@ -39,17 +39,17 @@ public final class CommonProto {
"2\035.bdledger.api.TransactionType\022\014\n\004from\030" + "2\035.bdledger.api.TransactionType\022\014\n\004from\030" +
"\005 \001(\014\022\r\n\005nonce\030\006 \001(\004\022\n\n\002to\030\007 \001(\014\022\014\n\004data" + "\005 \001(\014\022\r\n\005nonce\030\006 \001(\004\022\n\n\002to\030\007 \001(\014\022\014\n\004data" +
"\030\010 \001(\014\022\t\n\001v\030\t \001(\014\022\t\n\001r\030\n \001(\014\022\t\n\001s\030\013 \001(\014\"" + "\030\010 \001(\014\022\t\n\001v\030\t \001(\014\022\t\n\001r\030\n \001(\014\022\t\n\001s\030\013 \001(\014\"" +
"\327\001\n\005Block\022\r\n\005index\030\001 \001(\004\022\014\n\004hash\030\002 \001(\014\022\025" + "\343\001\n\005Block\022\014\n\004hash\030\001 \001(\014\022\025\n\rparent_hashes" +
"\n\rparent_hashes\030\003 \003(\014\022\021\n\twitnesses\030\004 \003(\014" + "\030\002 \003(\014\022\021\n\twitnesses\030\003 \003(\014\022\021\n\ttimestamp\030\004" +
"\022\021\n\ttimestamp\030\005 \001(\003\022\014\n\004size\030\006 \001(\004\022\031\n\021tra" + " \001(\003\022\014\n\004size\030\005 \001(\004\022\031\n\021transaction_count\030" +
"nsactions_root\030\007 \001(\014\022/\n\014transactions\030\010 \003" + "\006 \001(\r\022\031\n\021transactions_root\030\007 \001(\014\022/\n\014tran" +
"(\0132\031.bdledger.api.Transaction\022\032\n\022transac" + "sactions\030\010 \003(\0132\031.bdledger.api.Transactio" +
"tion_hashes\030\t \003(\014*o\n\017TransactionType\022\n\n\006" + "n\022\032\n\022transaction_hashes\030\t \003(\014*o\n\017Transac" +
"RECORD\020\000\022\013\n\007MESSAGE\020\001\022\025\n\021CONTRACT_CREATI" + "tionType\022\n\n\006RECORD\020\000\022\013\n\007MESSAGE\020\001\022\025\n\021CON" +
"ON\020\002\022\027\n\023CONTRACT_INVOCATION\020\003\022\023\n\017CONTRAC" + "TRACT_CREATION\020\002\022\027\n\023CONTRACT_INVOCATION\020" +
"T_STATUS\020\004BQ\n\030bdledger.api.grpc.commonB\013" + "\003\022\023\n\017CONTRACT_STATUS\020\004BQ\n\030bdledger.api.g" +
"CommonProtoP\001Z&bdware.org/bdledger/pkg/a" + "rpc.commonB\013CommonProtoP\001Z&bdware.org/bd" +
"pi/grpc/protob\006proto3" "ledger/pkg/api/grpc/protob\006proto3"
}; };
descriptor = com.google.protobuf.Descriptors.FileDescriptor descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData, .internalBuildGeneratedFileFrom(descriptorData,
@ -66,7 +66,7 @@ public final class CommonProto {
internal_static_bdledger_api_Block_fieldAccessorTable = new internal_static_bdledger_api_Block_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_bdledger_api_Block_descriptor, internal_static_bdledger_api_Block_descriptor,
new java.lang.String[] { "Index", "Hash", "ParentHashes", "Witnesses", "Timestamp", "Size", "TransactionsRoot", "Transactions", "TransactionHashes", }); new java.lang.String[] { "Hash", "ParentHashes", "Witnesses", "Timestamp", "Size", "TransactionCount", "TransactionsRoot", "Transactions", "TransactionHashes", });
} }
// @@protoc_insertion_point(outer_class_scope) // @@protoc_insertion_point(outer_class_scope)

View File

@ -20,11 +20,11 @@ import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
@javax.annotation.Generated( @javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.27.0)", value = "by gRPC proto compiler (version 1.27.0)",
comments = "Source: bdledger/api/ledger.proto") comments = "Source: bdledger/api/ledger.proto")
public final class TransactionLedgerGrpc { public final class LedgerGrpc {
private TransactionLedgerGrpc() {} private LedgerGrpc() {}
public static final String SERVICE_NAME = "bdledger.api.TransactionLedger"; public static final String SERVICE_NAME = "bdledger.api.Ledger";
// Static method descriptors that strictly reflect the proto. // Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor<bdledger.api.grpc.ledger.CreateLedgerRequest, private static volatile io.grpc.MethodDescriptor<bdledger.api.grpc.ledger.CreateLedgerRequest,
@ -38,10 +38,10 @@ public final class TransactionLedgerGrpc {
public static io.grpc.MethodDescriptor<bdledger.api.grpc.ledger.CreateLedgerRequest, public static io.grpc.MethodDescriptor<bdledger.api.grpc.ledger.CreateLedgerRequest,
bdledger.api.grpc.ledger.CreateLedgerResponse> getCreateLedgerMethod() { bdledger.api.grpc.ledger.CreateLedgerResponse> getCreateLedgerMethod() {
io.grpc.MethodDescriptor<bdledger.api.grpc.ledger.CreateLedgerRequest, bdledger.api.grpc.ledger.CreateLedgerResponse> getCreateLedgerMethod; io.grpc.MethodDescriptor<bdledger.api.grpc.ledger.CreateLedgerRequest, bdledger.api.grpc.ledger.CreateLedgerResponse> getCreateLedgerMethod;
if ((getCreateLedgerMethod = TransactionLedgerGrpc.getCreateLedgerMethod) == null) { if ((getCreateLedgerMethod = LedgerGrpc.getCreateLedgerMethod) == null) {
synchronized (TransactionLedgerGrpc.class) { synchronized (LedgerGrpc.class) {
if ((getCreateLedgerMethod = TransactionLedgerGrpc.getCreateLedgerMethod) == null) { if ((getCreateLedgerMethod = LedgerGrpc.getCreateLedgerMethod) == null) {
TransactionLedgerGrpc.getCreateLedgerMethod = getCreateLedgerMethod = LedgerGrpc.getCreateLedgerMethod = getCreateLedgerMethod =
io.grpc.MethodDescriptor.<bdledger.api.grpc.ledger.CreateLedgerRequest, bdledger.api.grpc.ledger.CreateLedgerResponse>newBuilder() io.grpc.MethodDescriptor.<bdledger.api.grpc.ledger.CreateLedgerRequest, bdledger.api.grpc.ledger.CreateLedgerResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateLedger")) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateLedger"))
@ -50,7 +50,7 @@ public final class TransactionLedgerGrpc {
bdledger.api.grpc.ledger.CreateLedgerRequest.getDefaultInstance())) bdledger.api.grpc.ledger.CreateLedgerRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
bdledger.api.grpc.ledger.CreateLedgerResponse.getDefaultInstance())) bdledger.api.grpc.ledger.CreateLedgerResponse.getDefaultInstance()))
.setSchemaDescriptor(new TransactionLedgerMethodDescriptorSupplier("CreateLedger")) .setSchemaDescriptor(new LedgerMethodDescriptorSupplier("CreateLedger"))
.build(); .build();
} }
} }
@ -69,10 +69,10 @@ public final class TransactionLedgerGrpc {
public static io.grpc.MethodDescriptor<com.google.protobuf.Empty, public static io.grpc.MethodDescriptor<com.google.protobuf.Empty,
bdledger.api.grpc.ledger.GetLedgersResponse> getGetLedgersMethod() { bdledger.api.grpc.ledger.GetLedgersResponse> getGetLedgersMethod() {
io.grpc.MethodDescriptor<com.google.protobuf.Empty, bdledger.api.grpc.ledger.GetLedgersResponse> getGetLedgersMethod; io.grpc.MethodDescriptor<com.google.protobuf.Empty, bdledger.api.grpc.ledger.GetLedgersResponse> getGetLedgersMethod;
if ((getGetLedgersMethod = TransactionLedgerGrpc.getGetLedgersMethod) == null) { if ((getGetLedgersMethod = LedgerGrpc.getGetLedgersMethod) == null) {
synchronized (TransactionLedgerGrpc.class) { synchronized (LedgerGrpc.class) {
if ((getGetLedgersMethod = TransactionLedgerGrpc.getGetLedgersMethod) == null) { if ((getGetLedgersMethod = LedgerGrpc.getGetLedgersMethod) == null) {
TransactionLedgerGrpc.getGetLedgersMethod = getGetLedgersMethod = LedgerGrpc.getGetLedgersMethod = getGetLedgersMethod =
io.grpc.MethodDescriptor.<com.google.protobuf.Empty, bdledger.api.grpc.ledger.GetLedgersResponse>newBuilder() io.grpc.MethodDescriptor.<com.google.protobuf.Empty, bdledger.api.grpc.ledger.GetLedgersResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetLedgers")) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetLedgers"))
@ -81,7 +81,7 @@ public final class TransactionLedgerGrpc {
com.google.protobuf.Empty.getDefaultInstance())) com.google.protobuf.Empty.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
bdledger.api.grpc.ledger.GetLedgersResponse.getDefaultInstance())) bdledger.api.grpc.ledger.GetLedgersResponse.getDefaultInstance()))
.setSchemaDescriptor(new TransactionLedgerMethodDescriptorSupplier("GetLedgers")) .setSchemaDescriptor(new LedgerMethodDescriptorSupplier("GetLedgers"))
.build(); .build();
} }
} }
@ -100,10 +100,10 @@ public final class TransactionLedgerGrpc {
public static io.grpc.MethodDescriptor<bdledger.api.grpc.ledger.SendTransactionRequest, public static io.grpc.MethodDescriptor<bdledger.api.grpc.ledger.SendTransactionRequest,
bdledger.api.grpc.ledger.SendTransactionResponse> getSendTransactionMethod() { bdledger.api.grpc.ledger.SendTransactionResponse> getSendTransactionMethod() {
io.grpc.MethodDescriptor<bdledger.api.grpc.ledger.SendTransactionRequest, bdledger.api.grpc.ledger.SendTransactionResponse> getSendTransactionMethod; io.grpc.MethodDescriptor<bdledger.api.grpc.ledger.SendTransactionRequest, bdledger.api.grpc.ledger.SendTransactionResponse> getSendTransactionMethod;
if ((getSendTransactionMethod = TransactionLedgerGrpc.getSendTransactionMethod) == null) { if ((getSendTransactionMethod = LedgerGrpc.getSendTransactionMethod) == null) {
synchronized (TransactionLedgerGrpc.class) { synchronized (LedgerGrpc.class) {
if ((getSendTransactionMethod = TransactionLedgerGrpc.getSendTransactionMethod) == null) { if ((getSendTransactionMethod = LedgerGrpc.getSendTransactionMethod) == null) {
TransactionLedgerGrpc.getSendTransactionMethod = getSendTransactionMethod = LedgerGrpc.getSendTransactionMethod = getSendTransactionMethod =
io.grpc.MethodDescriptor.<bdledger.api.grpc.ledger.SendTransactionRequest, bdledger.api.grpc.ledger.SendTransactionResponse>newBuilder() io.grpc.MethodDescriptor.<bdledger.api.grpc.ledger.SendTransactionRequest, bdledger.api.grpc.ledger.SendTransactionResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendTransaction")) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendTransaction"))
@ -112,7 +112,7 @@ public final class TransactionLedgerGrpc {
bdledger.api.grpc.ledger.SendTransactionRequest.getDefaultInstance())) bdledger.api.grpc.ledger.SendTransactionRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
bdledger.api.grpc.ledger.SendTransactionResponse.getDefaultInstance())) bdledger.api.grpc.ledger.SendTransactionResponse.getDefaultInstance()))
.setSchemaDescriptor(new TransactionLedgerMethodDescriptorSupplier("SendTransaction")) .setSchemaDescriptor(new LedgerMethodDescriptorSupplier("SendTransaction"))
.build(); .build();
} }
} }
@ -123,50 +123,50 @@ public final class TransactionLedgerGrpc {
/** /**
* Creates a new async stub that supports all call types for the service * Creates a new async stub that supports all call types for the service
*/ */
public static TransactionLedgerStub newStub(io.grpc.Channel channel) { public static LedgerStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory<TransactionLedgerStub> factory = io.grpc.stub.AbstractStub.StubFactory<LedgerStub> factory =
new io.grpc.stub.AbstractStub.StubFactory<TransactionLedgerStub>() { new io.grpc.stub.AbstractStub.StubFactory<LedgerStub>() {
@java.lang.Override @java.lang.Override
public TransactionLedgerStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { public LedgerStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TransactionLedgerStub(channel, callOptions); return new LedgerStub(channel, callOptions);
} }
}; };
return TransactionLedgerStub.newStub(factory, channel); return LedgerStub.newStub(factory, channel);
} }
/** /**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service * Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/ */
public static TransactionLedgerBlockingStub newBlockingStub( public static LedgerBlockingStub newBlockingStub(
io.grpc.Channel channel) { io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory<TransactionLedgerBlockingStub> factory = io.grpc.stub.AbstractStub.StubFactory<LedgerBlockingStub> factory =
new io.grpc.stub.AbstractStub.StubFactory<TransactionLedgerBlockingStub>() { new io.grpc.stub.AbstractStub.StubFactory<LedgerBlockingStub>() {
@java.lang.Override @java.lang.Override
public TransactionLedgerBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { public LedgerBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TransactionLedgerBlockingStub(channel, callOptions); return new LedgerBlockingStub(channel, callOptions);
} }
}; };
return TransactionLedgerBlockingStub.newStub(factory, channel); return LedgerBlockingStub.newStub(factory, channel);
} }
/** /**
* Creates a new ListenableFuture-style stub that supports unary calls on the service * Creates a new ListenableFuture-style stub that supports unary calls on the service
*/ */
public static TransactionLedgerFutureStub newFutureStub( public static LedgerFutureStub newFutureStub(
io.grpc.Channel channel) { io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory<TransactionLedgerFutureStub> factory = io.grpc.stub.AbstractStub.StubFactory<LedgerFutureStub> factory =
new io.grpc.stub.AbstractStub.StubFactory<TransactionLedgerFutureStub>() { new io.grpc.stub.AbstractStub.StubFactory<LedgerFutureStub>() {
@java.lang.Override @java.lang.Override
public TransactionLedgerFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { public LedgerFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TransactionLedgerFutureStub(channel, callOptions); return new LedgerFutureStub(channel, callOptions);
} }
}; };
return TransactionLedgerFutureStub.newStub(factory, channel); return LedgerFutureStub.newStub(factory, channel);
} }
/** /**
*/ */
public static abstract class TransactionLedgerImplBase implements io.grpc.BindableService { public static abstract class LedgerImplBase implements io.grpc.BindableService {
/** /**
*/ */
@ -218,16 +218,16 @@ public final class TransactionLedgerGrpc {
/** /**
*/ */
public static final class TransactionLedgerStub extends io.grpc.stub.AbstractAsyncStub<TransactionLedgerStub> { public static final class LedgerStub extends io.grpc.stub.AbstractAsyncStub<LedgerStub> {
private TransactionLedgerStub( private LedgerStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) { io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions); super(channel, callOptions);
} }
@java.lang.Override @java.lang.Override
protected TransactionLedgerStub build( protected LedgerStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) { io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TransactionLedgerStub(channel, callOptions); return new LedgerStub(channel, callOptions);
} }
/** /**
@ -257,16 +257,16 @@ public final class TransactionLedgerGrpc {
/** /**
*/ */
public static final class TransactionLedgerBlockingStub extends io.grpc.stub.AbstractBlockingStub<TransactionLedgerBlockingStub> { public static final class LedgerBlockingStub extends io.grpc.stub.AbstractBlockingStub<LedgerBlockingStub> {
private TransactionLedgerBlockingStub( private LedgerBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) { io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions); super(channel, callOptions);
} }
@java.lang.Override @java.lang.Override
protected TransactionLedgerBlockingStub build( protected LedgerBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) { io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TransactionLedgerBlockingStub(channel, callOptions); return new LedgerBlockingStub(channel, callOptions);
} }
/** /**
@ -293,16 +293,16 @@ public final class TransactionLedgerGrpc {
/** /**
*/ */
public static final class TransactionLedgerFutureStub extends io.grpc.stub.AbstractFutureStub<TransactionLedgerFutureStub> { public static final class LedgerFutureStub extends io.grpc.stub.AbstractFutureStub<LedgerFutureStub> {
private TransactionLedgerFutureStub( private LedgerFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) { io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions); super(channel, callOptions);
} }
@java.lang.Override @java.lang.Override
protected TransactionLedgerFutureStub build( protected LedgerFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) { io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TransactionLedgerFutureStub(channel, callOptions); return new LedgerFutureStub(channel, callOptions);
} }
/** /**
@ -339,10 +339,10 @@ public final class TransactionLedgerGrpc {
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
private final TransactionLedgerImplBase serviceImpl; private final LedgerImplBase serviceImpl;
private final int methodId; private final int methodId;
MethodHandlers(TransactionLedgerImplBase serviceImpl, int methodId) { MethodHandlers(LedgerImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl; this.serviceImpl = serviceImpl;
this.methodId = methodId; this.methodId = methodId;
} }
@ -379,9 +379,9 @@ public final class TransactionLedgerGrpc {
} }
} }
private static abstract class TransactionLedgerBaseDescriptorSupplier private static abstract class LedgerBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
TransactionLedgerBaseDescriptorSupplier() {} LedgerBaseDescriptorSupplier() {}
@java.lang.Override @java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
@ -390,21 +390,21 @@ public final class TransactionLedgerGrpc {
@java.lang.Override @java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("TransactionLedger"); return getFileDescriptor().findServiceByName("Ledger");
} }
} }
private static final class TransactionLedgerFileDescriptorSupplier private static final class LedgerFileDescriptorSupplier
extends TransactionLedgerBaseDescriptorSupplier { extends LedgerBaseDescriptorSupplier {
TransactionLedgerFileDescriptorSupplier() {} LedgerFileDescriptorSupplier() {}
} }
private static final class TransactionLedgerMethodDescriptorSupplier private static final class LedgerMethodDescriptorSupplier
extends TransactionLedgerBaseDescriptorSupplier extends LedgerBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName; private final String methodName;
TransactionLedgerMethodDescriptorSupplier(String methodName) { LedgerMethodDescriptorSupplier(String methodName) {
this.methodName = methodName; this.methodName = methodName;
} }
@ -419,11 +419,11 @@ public final class TransactionLedgerGrpc {
public static io.grpc.ServiceDescriptor getServiceDescriptor() { public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor; io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) { if (result == null) {
synchronized (TransactionLedgerGrpc.class) { synchronized (LedgerGrpc.class) {
result = serviceDescriptor; result = serviceDescriptor;
if (result == null) { if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new TransactionLedgerFileDescriptorSupplier()) .setSchemaDescriptor(new LedgerFileDescriptorSupplier())
.addMethod(getCreateLedgerMethod()) .addMethod(getCreateLedgerMethod())
.addMethod(getGetLedgersMethod()) .addMethod(getGetLedgersMethod())
.addMethod(getSendTransactionMethod()) .addMethod(getSendTransactionMethod())

View File

@ -64,16 +64,16 @@ public final class LedgerProto {
"ion\032b\n\013Transaction\022+\n\004type\030\001 \001(\0162\035.bdled" + "ion\032b\n\013Transaction\022+\n\004type\030\001 \001(\0162\035.bdled" +
"ger.api.TransactionType\022\014\n\004from\030\002 \001(\014\022\n\n" + "ger.api.TransactionType\022\014\n\004from\030\002 \001(\014\022\n\n" +
"\002to\030\003 \001(\014\022\014\n\004data\030\004 \001(\014\"\'\n\027SendTransacti" + "\002to\030\003 \001(\014\022\014\n\004data\030\004 \001(\014\"\'\n\027SendTransacti" +
"onResponse\022\014\n\004hash\030\001 \001(\0142\222\002\n\021Transaction" + "onResponse\022\014\n\004hash\030\001 \001(\0142\207\002\n\006Ledger\022U\n\014C" +
"Ledger\022U\n\014CreateLedger\022!.bdledger.api.Cr" + "reateLedger\022!.bdledger.api.CreateLedgerR" +
"eateLedgerRequest\032\".bdledger.api.CreateL" + "equest\032\".bdledger.api.CreateLedgerRespon" +
"edgerResponse\022F\n\nGetLedgers\022\026.google.pro" + "se\022F\n\nGetLedgers\022\026.google.protobuf.Empty" +
"tobuf.Empty\032 .bdledger.api.GetLedgersRes" + "\032 .bdledger.api.GetLedgersResponse\022^\n\017Se" +
"ponse\022^\n\017SendTransaction\022$.bdledger.api." + "ndTransaction\022$.bdledger.api.SendTransac" +
"SendTransactionRequest\032%.bdledger.api.Se" + "tionRequest\032%.bdledger.api.SendTransacti" +
"ndTransactionResponseBQ\n\030bdledger.api.gr" + "onResponseBQ\n\030bdledger.api.grpc.ledgerB\013" +
"pc.ledgerB\013LedgerProtoP\001Z&bdware.org/bdl" + "LedgerProtoP\001Z&bdware.org/bdledger/pkg/a" +
"edger/pkg/api/grpc/protob\006proto3" "pi/grpc/protob\006proto3"
}; };
descriptor = com.google.protobuf.Descriptors.FileDescriptor descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData, .internalBuildGeneratedFileFrom(descriptorData,