Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: Upgrade to the latest XDR file. #267

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions src/main/java/org/stellar/sdk/xdr/EncryptedBody.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Automatically generated by xdrgen
// DO NOT EDIT or your changes may be overwritten

package org.stellar.sdk.xdr;


import java.io.IOException;

import java.util.Arrays;

// === xdr source ============================================================

// typedef opaque EncryptedBody<64000>;

// ===========================================================================
public class EncryptedBody implements XdrElement {
private byte[] EncryptedBody;
public byte[] getEncryptedBody() {
return this.EncryptedBody;
}
public void setEncryptedBody(byte[] value) {
this.EncryptedBody = value;
}
public static void encode(XdrDataOutputStream stream, EncryptedBody encodedEncryptedBody) throws IOException {
int EncryptedBodysize = encodedEncryptedBody.EncryptedBody.length;
stream.writeInt(EncryptedBodysize);
stream.write(encodedEncryptedBody.getEncryptedBody(), 0, EncryptedBodysize);
}
public void encode(XdrDataOutputStream stream) throws IOException {
encode(stream, this);
}
public static EncryptedBody decode(XdrDataInputStream stream) throws IOException {
EncryptedBody decodedEncryptedBody = new EncryptedBody();
int EncryptedBodysize = stream.readInt();
decodedEncryptedBody.EncryptedBody = new byte[EncryptedBodysize];
stream.read(decodedEncryptedBody.EncryptedBody, 0, EncryptedBodysize);
return decodedEncryptedBody;
}
@Override
public int hashCode() {
return Arrays.hashCode(this.EncryptedBody);
}
@Override
public boolean equals(Object object) {
if (object == null || !(object instanceof EncryptedBody)) {
return false;
}

EncryptedBody other = (EncryptedBody) object;
return Arrays.equals(this.EncryptedBody, other.EncryptedBody);
}
}
73 changes: 73 additions & 0 deletions src/main/java/org/stellar/sdk/xdr/LedgerCloseMeta.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Automatically generated by xdrgen
// DO NOT EDIT or your changes may be overwritten

package org.stellar.sdk.xdr;


import java.io.IOException;

import com.google.common.base.Objects;

// === xdr source ============================================================

// union LedgerCloseMeta switch (int v)
// {
// case 0:
// LedgerCloseMetaV0 v0;
// };

// ===========================================================================
public class LedgerCloseMeta implements XdrElement {
public LedgerCloseMeta () {}
Integer v;
public Integer getDiscriminant() {
return this.v;
}
public void setDiscriminant(Integer value) {
this.v = value;
}
private LedgerCloseMetaV0 v0;
public LedgerCloseMetaV0 getV0() {
return this.v0;
}
public void setV0(LedgerCloseMetaV0 value) {
this.v0 = value;
}
public static void encode(XdrDataOutputStream stream, LedgerCloseMeta encodedLedgerCloseMeta) throws IOException {
//Xdrgen::AST::Typespecs::Int
//Integer
stream.writeInt(encodedLedgerCloseMeta.getDiscriminant().intValue());
switch (encodedLedgerCloseMeta.getDiscriminant()) {
case 0:
LedgerCloseMetaV0.encode(stream, encodedLedgerCloseMeta.v0);
break;
}
}
public void encode(XdrDataOutputStream stream) throws IOException {
encode(stream, this);
}
public static LedgerCloseMeta decode(XdrDataInputStream stream) throws IOException {
LedgerCloseMeta decodedLedgerCloseMeta = new LedgerCloseMeta();
Integer discriminant = stream.readInt();
decodedLedgerCloseMeta.setDiscriminant(discriminant);
switch (decodedLedgerCloseMeta.getDiscriminant()) {
case 0:
decodedLedgerCloseMeta.v0 = LedgerCloseMetaV0.decode(stream);
break;
}
return decodedLedgerCloseMeta;
}
@Override
public int hashCode() {
return Objects.hashCode(this.v0, this.v);
}
@Override
public boolean equals(Object object) {
if (object == null || !(object instanceof LedgerCloseMeta)) {
return false;
}

LedgerCloseMeta other = (LedgerCloseMeta) object;
return Objects.equal(this.v0, other.v0) && Objects.equal(this.v, other.v);
}
}
126 changes: 126 additions & 0 deletions src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV0.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// Automatically generated by xdrgen
// DO NOT EDIT or your changes may be overwritten

package org.stellar.sdk.xdr;


import java.io.IOException;

import com.google.common.base.Objects;
import java.util.Arrays;

// === xdr source ============================================================

// struct LedgerCloseMetaV0
// {
// LedgerHeaderHistoryEntry ledgerHeader;
// // NB: txSet is sorted in "Hash order"
// TransactionSet txSet;
//
// // NB: transactions are sorted in apply order here
// // fees for all transactions are processed first
// // followed by applying transactions
// TransactionResultMeta txProcessing<>;
//
// // upgrades are applied last
// UpgradeEntryMeta upgradesProcessing<>;
//
// // other misc information attached to the ledger close
// SCPHistoryEntry scpInfo<>;
// };

// ===========================================================================
public class LedgerCloseMetaV0 implements XdrElement {
public LedgerCloseMetaV0 () {}
private LedgerHeaderHistoryEntry ledgerHeader;
public LedgerHeaderHistoryEntry getLedgerHeader() {
return this.ledgerHeader;
}
public void setLedgerHeader(LedgerHeaderHistoryEntry value) {
this.ledgerHeader = value;
}
private TransactionSet txSet;
public TransactionSet getTxSet() {
return this.txSet;
}
public void setTxSet(TransactionSet value) {
this.txSet = value;
}
private TransactionResultMeta[] txProcessing;
public TransactionResultMeta[] getTxProcessing() {
return this.txProcessing;
}
public void setTxProcessing(TransactionResultMeta[] value) {
this.txProcessing = value;
}
private UpgradeEntryMeta[] upgradesProcessing;
public UpgradeEntryMeta[] getUpgradesProcessing() {
return this.upgradesProcessing;
}
public void setUpgradesProcessing(UpgradeEntryMeta[] value) {
this.upgradesProcessing = value;
}
private SCPHistoryEntry[] scpInfo;
public SCPHistoryEntry[] getScpInfo() {
return this.scpInfo;
}
public void setScpInfo(SCPHistoryEntry[] value) {
this.scpInfo = value;
}
public static void encode(XdrDataOutputStream stream, LedgerCloseMetaV0 encodedLedgerCloseMetaV0) throws IOException{
LedgerHeaderHistoryEntry.encode(stream, encodedLedgerCloseMetaV0.ledgerHeader);
TransactionSet.encode(stream, encodedLedgerCloseMetaV0.txSet);
int txProcessingsize = encodedLedgerCloseMetaV0.getTxProcessing().length;
stream.writeInt(txProcessingsize);
for (int i = 0; i < txProcessingsize; i++) {
TransactionResultMeta.encode(stream, encodedLedgerCloseMetaV0.txProcessing[i]);
}
int upgradesProcessingsize = encodedLedgerCloseMetaV0.getUpgradesProcessing().length;
stream.writeInt(upgradesProcessingsize);
for (int i = 0; i < upgradesProcessingsize; i++) {
UpgradeEntryMeta.encode(stream, encodedLedgerCloseMetaV0.upgradesProcessing[i]);
}
int scpInfosize = encodedLedgerCloseMetaV0.getScpInfo().length;
stream.writeInt(scpInfosize);
for (int i = 0; i < scpInfosize; i++) {
SCPHistoryEntry.encode(stream, encodedLedgerCloseMetaV0.scpInfo[i]);
}
}
public void encode(XdrDataOutputStream stream) throws IOException {
encode(stream, this);
}
public static LedgerCloseMetaV0 decode(XdrDataInputStream stream) throws IOException {
LedgerCloseMetaV0 decodedLedgerCloseMetaV0 = new LedgerCloseMetaV0();
decodedLedgerCloseMetaV0.ledgerHeader = LedgerHeaderHistoryEntry.decode(stream);
decodedLedgerCloseMetaV0.txSet = TransactionSet.decode(stream);
int txProcessingsize = stream.readInt();
decodedLedgerCloseMetaV0.txProcessing = new TransactionResultMeta[txProcessingsize];
for (int i = 0; i < txProcessingsize; i++) {
decodedLedgerCloseMetaV0.txProcessing[i] = TransactionResultMeta.decode(stream);
}
int upgradesProcessingsize = stream.readInt();
decodedLedgerCloseMetaV0.upgradesProcessing = new UpgradeEntryMeta[upgradesProcessingsize];
for (int i = 0; i < upgradesProcessingsize; i++) {
decodedLedgerCloseMetaV0.upgradesProcessing[i] = UpgradeEntryMeta.decode(stream);
}
int scpInfosize = stream.readInt();
decodedLedgerCloseMetaV0.scpInfo = new SCPHistoryEntry[scpInfosize];
for (int i = 0; i < scpInfosize; i++) {
decodedLedgerCloseMetaV0.scpInfo[i] = SCPHistoryEntry.decode(stream);
}
return decodedLedgerCloseMetaV0;
}
@Override
public int hashCode() {
return Objects.hashCode(this.ledgerHeader, this.txSet, Arrays.hashCode(this.txProcessing), Arrays.hashCode(this.upgradesProcessing), Arrays.hashCode(this.scpInfo));
}
@Override
public boolean equals(Object object) {
if (object == null || !(object instanceof LedgerCloseMetaV0)) {
return false;
}

LedgerCloseMetaV0 other = (LedgerCloseMetaV0) object;
return Objects.equal(this.ledgerHeader, other.ledgerHeader) && Objects.equal(this.txSet, other.txSet) && Arrays.equals(this.txProcessing, other.txProcessing) && Arrays.equals(this.upgradesProcessing, other.upgradesProcessing) && Arrays.equals(this.scpInfo, other.scpInfo);
}
}
9 changes: 8 additions & 1 deletion src/main/java/org/stellar/sdk/xdr/MessageType.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
// GET_SCP_STATE = 12,
//
// // new messages
// HELLO = 13
// HELLO = 13,
//
// SURVEY_REQUEST = 14,
// SURVEY_RESPONSE = 15
// };

// ===========================================================================
Expand All @@ -48,6 +51,8 @@ public enum MessageType implements XdrElement {
SCP_MESSAGE(11),
GET_SCP_STATE(12),
HELLO(13),
SURVEY_REQUEST(14),
SURVEY_RESPONSE(15),
;
private int mValue;

Expand Down Expand Up @@ -75,6 +80,8 @@ public static MessageType decode(XdrDataInputStream stream) throws IOException {
case 11: return SCP_MESSAGE;
case 12: return GET_SCP_STATE;
case 13: return HELLO;
case 14: return SURVEY_REQUEST;
case 15: return SURVEY_RESPONSE;
default:
throw new RuntimeException("Unknown enum value: " + value);
}
Expand Down
56 changes: 56 additions & 0 deletions src/main/java/org/stellar/sdk/xdr/PeerStatList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Automatically generated by xdrgen
// DO NOT EDIT or your changes may be overwritten

package org.stellar.sdk.xdr;


import java.io.IOException;

import java.util.Arrays;

// === xdr source ============================================================

// typedef PeerStats PeerStatList<25>;

// ===========================================================================
public class PeerStatList implements XdrElement {
private PeerStats[] PeerStatList;
public PeerStats[] getPeerStatList() {
return this.PeerStatList;
}
public void setPeerStatList(PeerStats[] value) {
this.PeerStatList = value;
}
public static void encode(XdrDataOutputStream stream, PeerStatList encodedPeerStatList) throws IOException {
int PeerStatListsize = encodedPeerStatList.getPeerStatList().length;
stream.writeInt(PeerStatListsize);
for (int i = 0; i < PeerStatListsize; i++) {
PeerStats.encode(stream, encodedPeerStatList.PeerStatList[i]);
}
}
public void encode(XdrDataOutputStream stream) throws IOException {
encode(stream, this);
}
public static PeerStatList decode(XdrDataInputStream stream) throws IOException {
PeerStatList decodedPeerStatList = new PeerStatList();
int PeerStatListsize = stream.readInt();
decodedPeerStatList.PeerStatList = new PeerStats[PeerStatListsize];
for (int i = 0; i < PeerStatListsize; i++) {
decodedPeerStatList.PeerStatList[i] = PeerStats.decode(stream);
}
return decodedPeerStatList;
}
@Override
public int hashCode() {
return Arrays.hashCode(this.PeerStatList);
}
@Override
public boolean equals(Object object) {
if (object == null || !(object instanceof PeerStatList)) {
return false;
}

PeerStatList other = (PeerStatList) object;
return Arrays.equals(this.PeerStatList, other.PeerStatList);
}
}
Loading