From 962a585b520bb2b25d9eef382e0932aa11461506 Mon Sep 17 00:00:00 2001
From: hewigovens <360470+hewigovens@users.noreply.github.com>
Date: Sat, 23 Feb 2019 14:39:31 +0800
Subject: [PATCH 1/8] Add ripple tx serialization
---
.../wallet/crypto/trustapp/proto/Ripple.java | 1700 +++++++++++++++++
docs/Contributing.md | 4 +
include/TrustWalletCore/TWRippleProto.h | 12 +
src/Ripple/BinaryCoding.h | 74 +
src/Ripple/Signer.cpp | 28 +
src/Ripple/Signer.h | 29 +
src/Ripple/Transaction.cpp | 87 +
src/Ripple/Transaction.h | 65 +
src/Zcash/Transaction.h | 5 -
src/interface/TWCoinTypeConfiguration.cpp | 3 +-
src/proto/Ripple.proto | 30 +
swift/Sources/Ripple.pb.swift | 172 ++
tests/Ripple/TransactionTests.cpp | 104 +
13 files changed, 2306 insertions(+), 7 deletions(-)
create mode 100644 JNI/java/com/wallet/crypto/trustapp/proto/Ripple.java
create mode 100644 include/TrustWalletCore/TWRippleProto.h
create mode 100644 src/Ripple/BinaryCoding.h
create mode 100644 src/Ripple/Signer.cpp
create mode 100644 src/Ripple/Signer.h
create mode 100644 src/Ripple/Transaction.cpp
create mode 100644 src/Ripple/Transaction.h
create mode 100644 src/proto/Ripple.proto
create mode 100644 swift/Sources/Ripple.pb.swift
create mode 100644 tests/Ripple/TransactionTests.cpp
diff --git a/JNI/java/com/wallet/crypto/trustapp/proto/Ripple.java b/JNI/java/com/wallet/crypto/trustapp/proto/Ripple.java
new file mode 100644
index 00000000000..6195da40036
--- /dev/null
+++ b/JNI/java/com/wallet/crypto/trustapp/proto/Ripple.java
@@ -0,0 +1,1700 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: Ripple.proto
+
+package com.wallet.crypto.trustapp.proto;
+
+public final class Ripple {
+ private Ripple() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions(
+ (com.google.protobuf.ExtensionRegistryLite) registry);
+ }
+ public interface SigningInputOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:TW.Ripple.Proto.SigningInput)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * int64 amount = 1;
+ */
+ long getAmount();
+
+ /**
+ * int64 fee = 2;
+ */
+ long getFee();
+
+ /**
+ * int32 sequence = 3;
+ */
+ int getSequence();
+
+ /**
+ * int32 last_ledger_sequence = 4;
+ */
+ int getLastLedgerSequence();
+
+ /**
+ * string account = 5;
+ */
+ java.lang.String getAccount();
+ /**
+ * string account = 5;
+ */
+ com.google.protobuf.ByteString
+ getAccountBytes();
+
+ /**
+ * string destination = 6;
+ */
+ java.lang.String getDestination();
+ /**
+ * string destination = 6;
+ */
+ com.google.protobuf.ByteString
+ getDestinationBytes();
+
+ /**
+ * int32 destination_tag = 7;
+ */
+ int getDestinationTag();
+
+ /**
+ * int32 flags = 8;
+ */
+ int getFlags();
+
+ /**
+ * bytes private_key = 9;
+ */
+ com.google.protobuf.ByteString getPrivateKey();
+ }
+ /**
+ *
+ * Input data necessary to create a signed transaction. + *+ * + * Protobuf type {@code TW.Ripple.Proto.SigningInput} + */ + public static final class SigningInput extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TW.Ripple.Proto.SigningInput) + SigningInputOrBuilder { + private static final long serialVersionUID = 0L; + // Use SigningInput.newBuilder() to construct. + private SigningInput(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private SigningInput() { + amount_ = 0L; + fee_ = 0L; + sequence_ = 0; + lastLedgerSequence_ = 0; + account_ = ""; + destination_ = ""; + destinationTag_ = 0; + flags_ = 0; + privateKey_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SigningInput( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + amount_ = input.readInt64(); + break; + } + case 16: { + + fee_ = input.readInt64(); + break; + } + case 24: { + + sequence_ = input.readInt32(); + break; + } + case 32: { + + lastLedgerSequence_ = input.readInt32(); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + account_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + destination_ = s; + break; + } + case 56: { + + destinationTag_ = input.readInt32(); + break; + } + case 64: { + + flags_ = input.readInt32(); + break; + } + case 74: { + + privateKey_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.wallet.crypto.trustapp.proto.Ripple.internal_static_TW_Ripple_Proto_SigningInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.wallet.crypto.trustapp.proto.Ripple.internal_static_TW_Ripple_Proto_SigningInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.wallet.crypto.trustapp.proto.Ripple.SigningInput.class, com.wallet.crypto.trustapp.proto.Ripple.SigningInput.Builder.class); + } + + public static final int AMOUNT_FIELD_NUMBER = 1; + private long amount_; + /** + *
int64 amount = 1;
+ */
+ public long getAmount() {
+ return amount_;
+ }
+
+ public static final int FEE_FIELD_NUMBER = 2;
+ private long fee_;
+ /**
+ * int64 fee = 2;
+ */
+ public long getFee() {
+ return fee_;
+ }
+
+ public static final int SEQUENCE_FIELD_NUMBER = 3;
+ private int sequence_;
+ /**
+ * int32 sequence = 3;
+ */
+ public int getSequence() {
+ return sequence_;
+ }
+
+ public static final int LAST_LEDGER_SEQUENCE_FIELD_NUMBER = 4;
+ private int lastLedgerSequence_;
+ /**
+ * int32 last_ledger_sequence = 4;
+ */
+ public int getLastLedgerSequence() {
+ return lastLedgerSequence_;
+ }
+
+ public static final int ACCOUNT_FIELD_NUMBER = 5;
+ private volatile java.lang.Object account_;
+ /**
+ * string account = 5;
+ */
+ public java.lang.String getAccount() {
+ java.lang.Object ref = account_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ account_ = s;
+ return s;
+ }
+ }
+ /**
+ * string account = 5;
+ */
+ public com.google.protobuf.ByteString
+ getAccountBytes() {
+ java.lang.Object ref = account_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ account_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int DESTINATION_FIELD_NUMBER = 6;
+ private volatile java.lang.Object destination_;
+ /**
+ * string destination = 6;
+ */
+ public java.lang.String getDestination() {
+ java.lang.Object ref = destination_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ destination_ = s;
+ return s;
+ }
+ }
+ /**
+ * string destination = 6;
+ */
+ public com.google.protobuf.ByteString
+ getDestinationBytes() {
+ java.lang.Object ref = destination_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ destination_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int DESTINATION_TAG_FIELD_NUMBER = 7;
+ private int destinationTag_;
+ /**
+ * int32 destination_tag = 7;
+ */
+ public int getDestinationTag() {
+ return destinationTag_;
+ }
+
+ public static final int FLAGS_FIELD_NUMBER = 8;
+ private int flags_;
+ /**
+ * int32 flags = 8;
+ */
+ public int getFlags() {
+ return flags_;
+ }
+
+ public static final int PRIVATE_KEY_FIELD_NUMBER = 9;
+ private com.google.protobuf.ByteString privateKey_;
+ /**
+ * bytes private_key = 9;
+ */
+ public com.google.protobuf.ByteString getPrivateKey() {
+ return privateKey_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (amount_ != 0L) {
+ output.writeInt64(1, amount_);
+ }
+ if (fee_ != 0L) {
+ output.writeInt64(2, fee_);
+ }
+ if (sequence_ != 0) {
+ output.writeInt32(3, sequence_);
+ }
+ if (lastLedgerSequence_ != 0) {
+ output.writeInt32(4, lastLedgerSequence_);
+ }
+ if (!getAccountBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 5, account_);
+ }
+ if (!getDestinationBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 6, destination_);
+ }
+ if (destinationTag_ != 0) {
+ output.writeInt32(7, destinationTag_);
+ }
+ if (flags_ != 0) {
+ output.writeInt32(8, flags_);
+ }
+ if (!privateKey_.isEmpty()) {
+ output.writeBytes(9, privateKey_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (amount_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(1, amount_);
+ }
+ if (fee_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(2, fee_);
+ }
+ if (sequence_ != 0) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(3, sequence_);
+ }
+ if (lastLedgerSequence_ != 0) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(4, lastLedgerSequence_);
+ }
+ if (!getAccountBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, account_);
+ }
+ if (!getDestinationBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, destination_);
+ }
+ if (destinationTag_ != 0) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(7, destinationTag_);
+ }
+ if (flags_ != 0) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(8, flags_);
+ }
+ if (!privateKey_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(9, privateKey_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.wallet.crypto.trustapp.proto.Ripple.SigningInput)) {
+ return super.equals(obj);
+ }
+ com.wallet.crypto.trustapp.proto.Ripple.SigningInput other = (com.wallet.crypto.trustapp.proto.Ripple.SigningInput) obj;
+
+ boolean result = true;
+ result = result && (getAmount()
+ == other.getAmount());
+ result = result && (getFee()
+ == other.getFee());
+ result = result && (getSequence()
+ == other.getSequence());
+ result = result && (getLastLedgerSequence()
+ == other.getLastLedgerSequence());
+ result = result && getAccount()
+ .equals(other.getAccount());
+ result = result && getDestination()
+ .equals(other.getDestination());
+ result = result && (getDestinationTag()
+ == other.getDestinationTag());
+ result = result && (getFlags()
+ == other.getFlags());
+ result = result && getPrivateKey()
+ .equals(other.getPrivateKey());
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + AMOUNT_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getAmount());
+ hash = (37 * hash) + FEE_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getFee());
+ hash = (37 * hash) + SEQUENCE_FIELD_NUMBER;
+ hash = (53 * hash) + getSequence();
+ hash = (37 * hash) + LAST_LEDGER_SEQUENCE_FIELD_NUMBER;
+ hash = (53 * hash) + getLastLedgerSequence();
+ hash = (37 * hash) + ACCOUNT_FIELD_NUMBER;
+ hash = (53 * hash) + getAccount().hashCode();
+ hash = (37 * hash) + DESTINATION_FIELD_NUMBER;
+ hash = (53 * hash) + getDestination().hashCode();
+ hash = (37 * hash) + DESTINATION_TAG_FIELD_NUMBER;
+ hash = (53 * hash) + getDestinationTag();
+ hash = (37 * hash) + FLAGS_FIELD_NUMBER;
+ hash = (53 * hash) + getFlags();
+ hash = (37 * hash) + PRIVATE_KEY_FIELD_NUMBER;
+ hash = (53 * hash) + getPrivateKey().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.wallet.crypto.trustapp.proto.Ripple.SigningInput prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * + * Input data necessary to create a signed transaction. + *+ * + * Protobuf type {@code TW.Ripple.Proto.SigningInput} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
int64 amount = 1;
+ */
+ public long getAmount() {
+ return amount_;
+ }
+ /**
+ * int64 amount = 1;
+ */
+ public Builder setAmount(long value) {
+
+ amount_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 amount = 1;
+ */
+ public Builder clearAmount() {
+
+ amount_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private long fee_ ;
+ /**
+ * int64 fee = 2;
+ */
+ public long getFee() {
+ return fee_;
+ }
+ /**
+ * int64 fee = 2;
+ */
+ public Builder setFee(long value) {
+
+ fee_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 fee = 2;
+ */
+ public Builder clearFee() {
+
+ fee_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private int sequence_ ;
+ /**
+ * int32 sequence = 3;
+ */
+ public int getSequence() {
+ return sequence_;
+ }
+ /**
+ * int32 sequence = 3;
+ */
+ public Builder setSequence(int value) {
+
+ sequence_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int32 sequence = 3;
+ */
+ public Builder clearSequence() {
+
+ sequence_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private int lastLedgerSequence_ ;
+ /**
+ * int32 last_ledger_sequence = 4;
+ */
+ public int getLastLedgerSequence() {
+ return lastLedgerSequence_;
+ }
+ /**
+ * int32 last_ledger_sequence = 4;
+ */
+ public Builder setLastLedgerSequence(int value) {
+
+ lastLedgerSequence_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int32 last_ledger_sequence = 4;
+ */
+ public Builder clearLastLedgerSequence() {
+
+ lastLedgerSequence_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object account_ = "";
+ /**
+ * string account = 5;
+ */
+ public java.lang.String getAccount() {
+ java.lang.Object ref = account_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ account_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * string account = 5;
+ */
+ public com.google.protobuf.ByteString
+ getAccountBytes() {
+ java.lang.Object ref = account_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ account_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * string account = 5;
+ */
+ public Builder setAccount(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ account_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * string account = 5;
+ */
+ public Builder clearAccount() {
+
+ account_ = getDefaultInstance().getAccount();
+ onChanged();
+ return this;
+ }
+ /**
+ * string account = 5;
+ */
+ public Builder setAccountBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ account_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object destination_ = "";
+ /**
+ * string destination = 6;
+ */
+ public java.lang.String getDestination() {
+ java.lang.Object ref = destination_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ destination_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * string destination = 6;
+ */
+ public com.google.protobuf.ByteString
+ getDestinationBytes() {
+ java.lang.Object ref = destination_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ destination_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * string destination = 6;
+ */
+ public Builder setDestination(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ destination_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * string destination = 6;
+ */
+ public Builder clearDestination() {
+
+ destination_ = getDefaultInstance().getDestination();
+ onChanged();
+ return this;
+ }
+ /**
+ * string destination = 6;
+ */
+ public Builder setDestinationBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ destination_ = value;
+ onChanged();
+ return this;
+ }
+
+ private int destinationTag_ ;
+ /**
+ * int32 destination_tag = 7;
+ */
+ public int getDestinationTag() {
+ return destinationTag_;
+ }
+ /**
+ * int32 destination_tag = 7;
+ */
+ public Builder setDestinationTag(int value) {
+
+ destinationTag_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int32 destination_tag = 7;
+ */
+ public Builder clearDestinationTag() {
+
+ destinationTag_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private int flags_ ;
+ /**
+ * int32 flags = 8;
+ */
+ public int getFlags() {
+ return flags_;
+ }
+ /**
+ * int32 flags = 8;
+ */
+ public Builder setFlags(int value) {
+
+ flags_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int32 flags = 8;
+ */
+ public Builder clearFlags() {
+
+ flags_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString privateKey_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * bytes private_key = 9;
+ */
+ public com.google.protobuf.ByteString getPrivateKey() {
+ return privateKey_;
+ }
+ /**
+ * bytes private_key = 9;
+ */
+ public Builder setPrivateKey(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ privateKey_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * bytes private_key = 9;
+ */
+ public Builder clearPrivateKey() {
+
+ privateKey_ = getDefaultInstance().getPrivateKey();
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:TW.Ripple.Proto.SigningInput)
+ }
+
+ // @@protoc_insertion_point(class_scope:TW.Ripple.Proto.SigningInput)
+ private static final com.wallet.crypto.trustapp.proto.Ripple.SigningInput DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.wallet.crypto.trustapp.proto.Ripple.SigningInput();
+ }
+
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningInput getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parserbytes encoded = 1;
+ */
+ com.google.protobuf.ByteString getEncoded();
+ }
+ /**
+ * + * Transaction signing output. + *+ * + * Protobuf type {@code TW.Ripple.Proto.SigningOutput} + */ + public static final class SigningOutput extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TW.Ripple.Proto.SigningOutput) + SigningOutputOrBuilder { + private static final long serialVersionUID = 0L; + // Use SigningOutput.newBuilder() to construct. + private SigningOutput(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private SigningOutput() { + encoded_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SigningOutput( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + + encoded_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.wallet.crypto.trustapp.proto.Ripple.internal_static_TW_Ripple_Proto_SigningOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.wallet.crypto.trustapp.proto.Ripple.internal_static_TW_Ripple_Proto_SigningOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.wallet.crypto.trustapp.proto.Ripple.SigningOutput.class, com.wallet.crypto.trustapp.proto.Ripple.SigningOutput.Builder.class); + } + + public static final int ENCODED_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString encoded_; + /** + *
bytes encoded = 1;
+ */
+ public com.google.protobuf.ByteString getEncoded() {
+ return encoded_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (!encoded_.isEmpty()) {
+ output.writeBytes(1, encoded_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!encoded_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, encoded_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.wallet.crypto.trustapp.proto.Ripple.SigningOutput)) {
+ return super.equals(obj);
+ }
+ com.wallet.crypto.trustapp.proto.Ripple.SigningOutput other = (com.wallet.crypto.trustapp.proto.Ripple.SigningOutput) obj;
+
+ boolean result = true;
+ result = result && getEncoded()
+ .equals(other.getEncoded());
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + ENCODED_FIELD_NUMBER;
+ hash = (53 * hash) + getEncoded().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.wallet.crypto.trustapp.proto.Ripple.SigningOutput prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * + * Transaction signing output. + *+ * + * Protobuf type {@code TW.Ripple.Proto.SigningOutput} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
bytes encoded = 1;
+ */
+ public com.google.protobuf.ByteString getEncoded() {
+ return encoded_;
+ }
+ /**
+ * bytes encoded = 1;
+ */
+ public Builder setEncoded(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ encoded_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * bytes encoded = 1;
+ */
+ public Builder clearEncoded() {
+
+ encoded_ = getDefaultInstance().getEncoded();
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:TW.Ripple.Proto.SigningOutput)
+ }
+
+ // @@protoc_insertion_point(class_scope:TW.Ripple.Proto.SigningOutput)
+ private static final com.wallet.crypto.trustapp.proto.Ripple.SigningOutput DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.wallet.crypto.trustapp.proto.Ripple.SigningOutput();
+ }
+
+ public static com.wallet.crypto.trustapp.proto.Ripple.SigningOutput getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parserint32 destination_tag = 7;
+ * int64 destination_tag = 7;
*/
- int getDestinationTag();
+ long getDestinationTag();
/**
- * int32 flags = 8;
+ * int64 flags = 8;
*/
- int getFlags();
+ long getFlags();
/**
* bytes private_key = 9;
@@ -96,8 +96,8 @@ private SigningInput() {
lastLedgerSequence_ = 0;
account_ = "";
destination_ = "";
- destinationTag_ = 0;
- flags_ = 0;
+ destinationTag_ = 0L;
+ flags_ = 0L;
privateKey_ = com.google.protobuf.ByteString.EMPTY;
}
@@ -159,12 +159,12 @@ private SigningInput(
}
case 56: {
- destinationTag_ = input.readInt32();
+ destinationTag_ = input.readInt64();
break;
}
case 64: {
- flags_ = input.readInt32();
+ flags_ = input.readInt64();
break;
}
case 74: {
@@ -309,20 +309,20 @@ public java.lang.String getDestination() {
}
public static final int DESTINATION_TAG_FIELD_NUMBER = 7;
- private int destinationTag_;
+ private long destinationTag_;
/**
- * int32 destination_tag = 7;
+ * int64 destination_tag = 7;
*/
- public int getDestinationTag() {
+ public long getDestinationTag() {
return destinationTag_;
}
public static final int FLAGS_FIELD_NUMBER = 8;
- private int flags_;
+ private long flags_;
/**
- * int32 flags = 8;
+ * int64 flags = 8;
*/
- public int getFlags() {
+ public long getFlags() {
return flags_;
}
@@ -367,11 +367,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (!getDestinationBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, destination_);
}
- if (destinationTag_ != 0) {
- output.writeInt32(7, destinationTag_);
+ if (destinationTag_ != 0L) {
+ output.writeInt64(7, destinationTag_);
}
- if (flags_ != 0) {
- output.writeInt32(8, flags_);
+ if (flags_ != 0L) {
+ output.writeInt64(8, flags_);
}
if (!privateKey_.isEmpty()) {
output.writeBytes(9, privateKey_);
@@ -407,13 +407,13 @@ public int getSerializedSize() {
if (!getDestinationBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, destination_);
}
- if (destinationTag_ != 0) {
+ if (destinationTag_ != 0L) {
size += com.google.protobuf.CodedOutputStream
- .computeInt32Size(7, destinationTag_);
+ .computeInt64Size(7, destinationTag_);
}
- if (flags_ != 0) {
+ if (flags_ != 0L) {
size += com.google.protobuf.CodedOutputStream
- .computeInt32Size(8, flags_);
+ .computeInt64Size(8, flags_);
}
if (!privateKey_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
@@ -479,9 +479,11 @@ public int hashCode() {
hash = (37 * hash) + DESTINATION_FIELD_NUMBER;
hash = (53 * hash) + getDestination().hashCode();
hash = (37 * hash) + DESTINATION_TAG_FIELD_NUMBER;
- hash = (53 * hash) + getDestinationTag();
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getDestinationTag());
hash = (37 * hash) + FLAGS_FIELD_NUMBER;
- hash = (53 * hash) + getFlags();
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getFlags());
hash = (37 * hash) + PRIVATE_KEY_FIELD_NUMBER;
hash = (53 * hash) + getPrivateKey().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
@@ -633,9 +635,9 @@ public Builder clear() {
destination_ = "";
- destinationTag_ = 0;
+ destinationTag_ = 0L;
- flags_ = 0;
+ flags_ = 0L;
privateKey_ = com.google.protobuf.ByteString.EMPTY;
@@ -742,10 +744,10 @@ public Builder mergeFrom(com.wallet.crypto.trustapp.proto.Ripple.SigningInput ot
destination_ = other.destination_;
onChanged();
}
- if (other.getDestinationTag() != 0) {
+ if (other.getDestinationTag() != 0L) {
setDestinationTag(other.getDestinationTag());
}
- if (other.getFlags() != 0) {
+ if (other.getFlags() != 0L) {
setFlags(other.getFlags());
}
if (other.getPrivateKey() != com.google.protobuf.ByteString.EMPTY) {
@@ -1022,54 +1024,54 @@ public Builder setDestinationBytes(
return this;
}
- private int destinationTag_ ;
+ private long destinationTag_ ;
/**
- * int32 destination_tag = 7;
+ * int64 destination_tag = 7;
*/
- public int getDestinationTag() {
+ public long getDestinationTag() {
return destinationTag_;
}
/**
- * int32 destination_tag = 7;
+ * int64 destination_tag = 7;
*/
- public Builder setDestinationTag(int value) {
+ public Builder setDestinationTag(long value) {
destinationTag_ = value;
onChanged();
return this;
}
/**
- * int32 destination_tag = 7;
+ * int64 destination_tag = 7;
*/
public Builder clearDestinationTag() {
- destinationTag_ = 0;
+ destinationTag_ = 0L;
onChanged();
return this;
}
- private int flags_ ;
+ private long flags_ ;
/**
- * int32 flags = 8;
+ * int64 flags = 8;
*/
- public int getFlags() {
+ public long getFlags() {
return flags_;
}
/**
- * int32 flags = 8;
+ * int64 flags = 8;
*/
- public Builder setFlags(int value) {
+ public Builder setFlags(long value) {
flags_ = value;
onChanged();
return this;
}
/**
- * int32 flags = 8;
+ * int64 flags = 8;
*/
public Builder clearFlags() {
- flags_ = 0;
+ flags_ = 0L;
onChanged();
return this;
}
@@ -1665,8 +1667,8 @@ public com.wallet.crypto.trustapp.proto.Ripple.SigningOutput getDefaultInstanceF
"ingInput\022\016\n\006amount\030\001 \001(\003\022\013\n\003fee\030\002 \001(\003\022\020\n" +
"\010sequence\030\003 \001(\005\022\034\n\024last_ledger_sequence\030" +
"\004 \001(\005\022\017\n\007account\030\005 \001(\t\022\023\n\013destination\030\006 " +
- "\001(\t\022\027\n\017destination_tag\030\007 \001(\005\022\r\n\005flags\030\010 " +
- "\001(\005\022\023\n\013private_key\030\t \001(\014\" \n\rSigningOutpu" +
+ "\001(\t\022\027\n\017destination_tag\030\007 \001(\003\022\r\n\005flags\030\010 " +
+ "\001(\003\022\023\n\013private_key\030\t \001(\014\" \n\rSigningOutpu" +
"t\022\017\n\007encoded\030\001 \001(\014B\"\n com.wallet.crypto." +
"trustapp.protob\006proto3"
};
diff --git a/swift/Sources/Ripple.pb.swift b/swift/Sources/Ripple.pb.swift
index 2f9b9c664cd..e6b94cb1685 100644
--- a/swift/Sources/Ripple.pb.swift
+++ b/swift/Sources/Ripple.pb.swift
@@ -37,9 +37,9 @@ public struct TW_Ripple_Proto_SigningInput {
public var destination: String = String()
- public var destinationTag: Int32 = 0
+ public var destinationTag: Int64 = 0
- public var flags: Int32 = 0
+ public var flags: Int64 = 0
public var privateKey: Data = SwiftProtobuf.Internal.emptyData
@@ -88,8 +88,8 @@ extension TW_Ripple_Proto_SigningInput: SwiftProtobuf.Message, SwiftProtobuf._Me
case 4: try decoder.decodeSingularInt32Field(value: &self.lastLedgerSequence)
case 5: try decoder.decodeSingularStringField(value: &self.account)
case 6: try decoder.decodeSingularStringField(value: &self.destination)
- case 7: try decoder.decodeSingularInt32Field(value: &self.destinationTag)
- case 8: try decoder.decodeSingularInt32Field(value: &self.flags)
+ case 7: try decoder.decodeSingularInt64Field(value: &self.destinationTag)
+ case 8: try decoder.decodeSingularInt64Field(value: &self.flags)
case 9: try decoder.decodeSingularBytesField(value: &self.privateKey)
default: break
}
@@ -116,10 +116,10 @@ extension TW_Ripple_Proto_SigningInput: SwiftProtobuf.Message, SwiftProtobuf._Me
try visitor.visitSingularStringField(value: self.destination, fieldNumber: 6)
}
if self.destinationTag != 0 {
- try visitor.visitSingularInt32Field(value: self.destinationTag, fieldNumber: 7)
+ try visitor.visitSingularInt64Field(value: self.destinationTag, fieldNumber: 7)
}
if self.flags != 0 {
- try visitor.visitSingularInt32Field(value: self.flags, fieldNumber: 8)
+ try visitor.visitSingularInt64Field(value: self.flags, fieldNumber: 8)
}
if !self.privateKey.isEmpty {
try visitor.visitSingularBytesField(value: self.privateKey, fieldNumber: 9)
From 569cd90e5c3771884740a2b6eb3793c897edb8bd Mon Sep 17 00:00:00 2001
From: hewigovens <360470+hewigovens@users.noreply.github.com>
Date: Sat, 23 Feb 2019 21:59:09 +0800
Subject: [PATCH 3/8] add TWRippleSigner and swift tests
---
JNI/cpp/RippleSigner.c | 35 +++++++++++++++++++
JNI/cpp/RippleSigner.h | 24 +++++++++++++
JNI/java/wallet/core/jni/CoinType.java | 1 -
JNI/java/wallet/core/jni/RippleSigner.java | 32 +++++++++++++++++
include/TrustWalletCore/TWRippleSigner.h | 23 +++++++++++++
src/Bitcoin/TransactionSigner.cpp | 4 +--
src/Ripple/Transaction.cpp | 2 +-
src/interface/TWRippleSigner.cpp | 40 ++++++++++++++++++++++
swift/Sources/CoinType.swift | 1 -
swift/Sources/RippleSigner.swift | 30 ++++++++++++++++
swift/Sources/TrustWalletCore.h | 1 +
swift/Tests/RippleTests.swift | 17 +++++++++
12 files changed, 205 insertions(+), 5 deletions(-)
create mode 100644 JNI/cpp/RippleSigner.c
create mode 100644 JNI/cpp/RippleSigner.h
create mode 100644 JNI/java/wallet/core/jni/RippleSigner.java
create mode 100644 include/TrustWalletCore/TWRippleSigner.h
create mode 100644 src/interface/TWRippleSigner.cpp
create mode 100644 swift/Sources/RippleSigner.swift
diff --git a/JNI/cpp/RippleSigner.c b/JNI/cpp/RippleSigner.c
new file mode 100644
index 00000000000..d1a48bc9a53
--- /dev/null
+++ b/JNI/cpp/RippleSigner.c
@@ -0,0 +1,35 @@
+// Copyright © 2017-2019 Trust.
+//
+// This file is part of Trust. The full Trust copyright notice, including
+// terms governing use, modification, and redistribution, is contained in the
+// file LICENSE at the root of the source code distribution tree.
+//
+// This is a GENERATED FILE, changes made here WILL BE LOST.
+//
+
+#include int64 amount = 1;
+ */
+ long getAmount();
+
+ /**
+ * int64 fee = 2;
+ */
+ long getFee();
+
+ /**
+ * int32 sequence = 3;
+ */
+ int getSequence();
+
+ /**
+ * int32 last_ledger_sequence = 4;
+ */
+ int getLastLedgerSequence();
+
+ /**
+ * string account = 5;
+ */
+ java.lang.String getAccount();
+ /**
+ * string account = 5;
+ */
+ com.google.protobuf.ByteString
+ getAccountBytes();
+
+ /**
+ * string destination = 6;
+ */
+ java.lang.String getDestination();
+ /**
+ * string destination = 6;
+ */
+ com.google.protobuf.ByteString
+ getDestinationBytes();
+
+ /**
+ * int64 destination_tag = 7;
+ */
+ long getDestinationTag();
+
+ /**
+ * int64 flags = 8;
+ */
+ long getFlags();
+
+ /**
+ * bytes private_key = 9;
+ */
+ com.google.protobuf.ByteString getPrivateKey();
+ }
+ /**
+ * + * Input data necessary to create a signed transaction. + *+ * + * Protobuf type {@code TW.Ripple.Proto.SigningInput} + */ + public static final class SigningInput extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TW.Ripple.Proto.SigningInput) + SigningInputOrBuilder { + private static final long serialVersionUID = 0L; + // Use SigningInput.newBuilder() to construct. + private SigningInput(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private SigningInput() { + amount_ = 0L; + fee_ = 0L; + sequence_ = 0; + lastLedgerSequence_ = 0; + account_ = ""; + destination_ = ""; + destinationTag_ = 0L; + flags_ = 0L; + privateKey_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SigningInput( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + amount_ = input.readInt64(); + break; + } + case 16: { + + fee_ = input.readInt64(); + break; + } + case 24: { + + sequence_ = input.readInt32(); + break; + } + case 32: { + + lastLedgerSequence_ = input.readInt32(); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + account_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + destination_ = s; + break; + } + case 56: { + + destinationTag_ = input.readInt64(); + break; + } + case 64: { + + flags_ = input.readInt64(); + break; + } + case 74: { + + privateKey_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return wallet.core.jni.proto.Ripple.internal_static_TW_Ripple_Proto_SigningInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return wallet.core.jni.proto.Ripple.internal_static_TW_Ripple_Proto_SigningInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + wallet.core.jni.proto.Ripple.SigningInput.class, wallet.core.jni.proto.Ripple.SigningInput.Builder.class); + } + + public static final int AMOUNT_FIELD_NUMBER = 1; + private long amount_; + /** + *
int64 amount = 1;
+ */
+ public long getAmount() {
+ return amount_;
+ }
+
+ public static final int FEE_FIELD_NUMBER = 2;
+ private long fee_;
+ /**
+ * int64 fee = 2;
+ */
+ public long getFee() {
+ return fee_;
+ }
+
+ public static final int SEQUENCE_FIELD_NUMBER = 3;
+ private int sequence_;
+ /**
+ * int32 sequence = 3;
+ */
+ public int getSequence() {
+ return sequence_;
+ }
+
+ public static final int LAST_LEDGER_SEQUENCE_FIELD_NUMBER = 4;
+ private int lastLedgerSequence_;
+ /**
+ * int32 last_ledger_sequence = 4;
+ */
+ public int getLastLedgerSequence() {
+ return lastLedgerSequence_;
+ }
+
+ public static final int ACCOUNT_FIELD_NUMBER = 5;
+ private volatile java.lang.Object account_;
+ /**
+ * string account = 5;
+ */
+ public java.lang.String getAccount() {
+ java.lang.Object ref = account_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ account_ = s;
+ return s;
+ }
+ }
+ /**
+ * string account = 5;
+ */
+ public com.google.protobuf.ByteString
+ getAccountBytes() {
+ java.lang.Object ref = account_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ account_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int DESTINATION_FIELD_NUMBER = 6;
+ private volatile java.lang.Object destination_;
+ /**
+ * string destination = 6;
+ */
+ public java.lang.String getDestination() {
+ java.lang.Object ref = destination_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ destination_ = s;
+ return s;
+ }
+ }
+ /**
+ * string destination = 6;
+ */
+ public com.google.protobuf.ByteString
+ getDestinationBytes() {
+ java.lang.Object ref = destination_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ destination_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int DESTINATION_TAG_FIELD_NUMBER = 7;
+ private long destinationTag_;
+ /**
+ * int64 destination_tag = 7;
+ */
+ public long getDestinationTag() {
+ return destinationTag_;
+ }
+
+ public static final int FLAGS_FIELD_NUMBER = 8;
+ private long flags_;
+ /**
+ * int64 flags = 8;
+ */
+ public long getFlags() {
+ return flags_;
+ }
+
+ public static final int PRIVATE_KEY_FIELD_NUMBER = 9;
+ private com.google.protobuf.ByteString privateKey_;
+ /**
+ * bytes private_key = 9;
+ */
+ public com.google.protobuf.ByteString getPrivateKey() {
+ return privateKey_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (amount_ != 0L) {
+ output.writeInt64(1, amount_);
+ }
+ if (fee_ != 0L) {
+ output.writeInt64(2, fee_);
+ }
+ if (sequence_ != 0) {
+ output.writeInt32(3, sequence_);
+ }
+ if (lastLedgerSequence_ != 0) {
+ output.writeInt32(4, lastLedgerSequence_);
+ }
+ if (!getAccountBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 5, account_);
+ }
+ if (!getDestinationBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 6, destination_);
+ }
+ if (destinationTag_ != 0L) {
+ output.writeInt64(7, destinationTag_);
+ }
+ if (flags_ != 0L) {
+ output.writeInt64(8, flags_);
+ }
+ if (!privateKey_.isEmpty()) {
+ output.writeBytes(9, privateKey_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (amount_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(1, amount_);
+ }
+ if (fee_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(2, fee_);
+ }
+ if (sequence_ != 0) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(3, sequence_);
+ }
+ if (lastLedgerSequence_ != 0) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(4, lastLedgerSequence_);
+ }
+ if (!getAccountBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, account_);
+ }
+ if (!getDestinationBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, destination_);
+ }
+ if (destinationTag_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(7, destinationTag_);
+ }
+ if (flags_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(8, flags_);
+ }
+ if (!privateKey_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(9, privateKey_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof wallet.core.jni.proto.Ripple.SigningInput)) {
+ return super.equals(obj);
+ }
+ wallet.core.jni.proto.Ripple.SigningInput other = (wallet.core.jni.proto.Ripple.SigningInput) obj;
+
+ boolean result = true;
+ result = result && (getAmount()
+ == other.getAmount());
+ result = result && (getFee()
+ == other.getFee());
+ result = result && (getSequence()
+ == other.getSequence());
+ result = result && (getLastLedgerSequence()
+ == other.getLastLedgerSequence());
+ result = result && getAccount()
+ .equals(other.getAccount());
+ result = result && getDestination()
+ .equals(other.getDestination());
+ result = result && (getDestinationTag()
+ == other.getDestinationTag());
+ result = result && (getFlags()
+ == other.getFlags());
+ result = result && getPrivateKey()
+ .equals(other.getPrivateKey());
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + AMOUNT_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getAmount());
+ hash = (37 * hash) + FEE_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getFee());
+ hash = (37 * hash) + SEQUENCE_FIELD_NUMBER;
+ hash = (53 * hash) + getSequence();
+ hash = (37 * hash) + LAST_LEDGER_SEQUENCE_FIELD_NUMBER;
+ hash = (53 * hash) + getLastLedgerSequence();
+ hash = (37 * hash) + ACCOUNT_FIELD_NUMBER;
+ hash = (53 * hash) + getAccount().hashCode();
+ hash = (37 * hash) + DESTINATION_FIELD_NUMBER;
+ hash = (53 * hash) + getDestination().hashCode();
+ hash = (37 * hash) + DESTINATION_TAG_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getDestinationTag());
+ hash = (37 * hash) + FLAGS_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getFlags());
+ hash = (37 * hash) + PRIVATE_KEY_FIELD_NUMBER;
+ hash = (53 * hash) + getPrivateKey().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static wallet.core.jni.proto.Ripple.SigningInput parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningInput parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(wallet.core.jni.proto.Ripple.SigningInput prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * + * Input data necessary to create a signed transaction. + *+ * + * Protobuf type {@code TW.Ripple.Proto.SigningInput} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
int64 amount = 1;
+ */
+ public long getAmount() {
+ return amount_;
+ }
+ /**
+ * int64 amount = 1;
+ */
+ public Builder setAmount(long value) {
+
+ amount_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 amount = 1;
+ */
+ public Builder clearAmount() {
+
+ amount_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private long fee_ ;
+ /**
+ * int64 fee = 2;
+ */
+ public long getFee() {
+ return fee_;
+ }
+ /**
+ * int64 fee = 2;
+ */
+ public Builder setFee(long value) {
+
+ fee_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 fee = 2;
+ */
+ public Builder clearFee() {
+
+ fee_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private int sequence_ ;
+ /**
+ * int32 sequence = 3;
+ */
+ public int getSequence() {
+ return sequence_;
+ }
+ /**
+ * int32 sequence = 3;
+ */
+ public Builder setSequence(int value) {
+
+ sequence_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int32 sequence = 3;
+ */
+ public Builder clearSequence() {
+
+ sequence_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private int lastLedgerSequence_ ;
+ /**
+ * int32 last_ledger_sequence = 4;
+ */
+ public int getLastLedgerSequence() {
+ return lastLedgerSequence_;
+ }
+ /**
+ * int32 last_ledger_sequence = 4;
+ */
+ public Builder setLastLedgerSequence(int value) {
+
+ lastLedgerSequence_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int32 last_ledger_sequence = 4;
+ */
+ public Builder clearLastLedgerSequence() {
+
+ lastLedgerSequence_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object account_ = "";
+ /**
+ * string account = 5;
+ */
+ public java.lang.String getAccount() {
+ java.lang.Object ref = account_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ account_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * string account = 5;
+ */
+ public com.google.protobuf.ByteString
+ getAccountBytes() {
+ java.lang.Object ref = account_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ account_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * string account = 5;
+ */
+ public Builder setAccount(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ account_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * string account = 5;
+ */
+ public Builder clearAccount() {
+
+ account_ = getDefaultInstance().getAccount();
+ onChanged();
+ return this;
+ }
+ /**
+ * string account = 5;
+ */
+ public Builder setAccountBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ account_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object destination_ = "";
+ /**
+ * string destination = 6;
+ */
+ public java.lang.String getDestination() {
+ java.lang.Object ref = destination_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ destination_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * string destination = 6;
+ */
+ public com.google.protobuf.ByteString
+ getDestinationBytes() {
+ java.lang.Object ref = destination_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ destination_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * string destination = 6;
+ */
+ public Builder setDestination(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ destination_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * string destination = 6;
+ */
+ public Builder clearDestination() {
+
+ destination_ = getDefaultInstance().getDestination();
+ onChanged();
+ return this;
+ }
+ /**
+ * string destination = 6;
+ */
+ public Builder setDestinationBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ destination_ = value;
+ onChanged();
+ return this;
+ }
+
+ private long destinationTag_ ;
+ /**
+ * int64 destination_tag = 7;
+ */
+ public long getDestinationTag() {
+ return destinationTag_;
+ }
+ /**
+ * int64 destination_tag = 7;
+ */
+ public Builder setDestinationTag(long value) {
+
+ destinationTag_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 destination_tag = 7;
+ */
+ public Builder clearDestinationTag() {
+
+ destinationTag_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private long flags_ ;
+ /**
+ * int64 flags = 8;
+ */
+ public long getFlags() {
+ return flags_;
+ }
+ /**
+ * int64 flags = 8;
+ */
+ public Builder setFlags(long value) {
+
+ flags_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 flags = 8;
+ */
+ public Builder clearFlags() {
+
+ flags_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString privateKey_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * bytes private_key = 9;
+ */
+ public com.google.protobuf.ByteString getPrivateKey() {
+ return privateKey_;
+ }
+ /**
+ * bytes private_key = 9;
+ */
+ public Builder setPrivateKey(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ privateKey_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * bytes private_key = 9;
+ */
+ public Builder clearPrivateKey() {
+
+ privateKey_ = getDefaultInstance().getPrivateKey();
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:TW.Ripple.Proto.SigningInput)
+ }
+
+ // @@protoc_insertion_point(class_scope:TW.Ripple.Proto.SigningInput)
+ private static final wallet.core.jni.proto.Ripple.SigningInput DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new wallet.core.jni.proto.Ripple.SigningInput();
+ }
+
+ public static wallet.core.jni.proto.Ripple.SigningInput getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parserbytes encoded = 1;
+ */
+ com.google.protobuf.ByteString getEncoded();
+ }
+ /**
+ * + * Transaction signing output. + *+ * + * Protobuf type {@code TW.Ripple.Proto.SigningOutput} + */ + public static final class SigningOutput extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TW.Ripple.Proto.SigningOutput) + SigningOutputOrBuilder { + private static final long serialVersionUID = 0L; + // Use SigningOutput.newBuilder() to construct. + private SigningOutput(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private SigningOutput() { + encoded_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SigningOutput( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + + encoded_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return wallet.core.jni.proto.Ripple.internal_static_TW_Ripple_Proto_SigningOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return wallet.core.jni.proto.Ripple.internal_static_TW_Ripple_Proto_SigningOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + wallet.core.jni.proto.Ripple.SigningOutput.class, wallet.core.jni.proto.Ripple.SigningOutput.Builder.class); + } + + public static final int ENCODED_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString encoded_; + /** + *
bytes encoded = 1;
+ */
+ public com.google.protobuf.ByteString getEncoded() {
+ return encoded_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (!encoded_.isEmpty()) {
+ output.writeBytes(1, encoded_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!encoded_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, encoded_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof wallet.core.jni.proto.Ripple.SigningOutput)) {
+ return super.equals(obj);
+ }
+ wallet.core.jni.proto.Ripple.SigningOutput other = (wallet.core.jni.proto.Ripple.SigningOutput) obj;
+
+ boolean result = true;
+ result = result && getEncoded()
+ .equals(other.getEncoded());
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + ENCODED_FIELD_NUMBER;
+ hash = (53 * hash) + getEncoded().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static wallet.core.jni.proto.Ripple.SigningOutput parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(wallet.core.jni.proto.Ripple.SigningOutput prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * + * Transaction signing output. + *+ * + * Protobuf type {@code TW.Ripple.Proto.SigningOutput} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
bytes encoded = 1;
+ */
+ public com.google.protobuf.ByteString getEncoded() {
+ return encoded_;
+ }
+ /**
+ * bytes encoded = 1;
+ */
+ public Builder setEncoded(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ encoded_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * bytes encoded = 1;
+ */
+ public Builder clearEncoded() {
+
+ encoded_ = getDefaultInstance().getEncoded();
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:TW.Ripple.Proto.SigningOutput)
+ }
+
+ // @@protoc_insertion_point(class_scope:TW.Ripple.Proto.SigningOutput)
+ private static final wallet.core.jni.proto.Ripple.SigningOutput DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new wallet.core.jni.proto.Ripple.SigningOutput();
+ }
+
+ public static wallet.core.jni.proto.Ripple.SigningOutput getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser