Skip to content

Commit

Permalink
Bump stellar-xdr to v21.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat committed Apr 27, 2024
1 parent d152fe7 commit b5f0773
Show file tree
Hide file tree
Showing 16 changed files with 1,487 additions and 54 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ As this project is pre 1.0, breaking changes may happen for minor version bumps.

## Pending
### Update
* `Sep10Challenge.ChallengeTransaction`'s equals behavior has changed, will compare the transaction's `signatureBase`, not just the transaction hash. ([#588](https://github.com/lightsail-network/java-stellar-sdk/pull/588))
* Bump stellar-xdr to v21.1. ([#589](https://github.com/lightsail-network/java-stellar-sdk/pull/589))

## 0.43.1
### Update
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ xdr/Stellar-contract.x \
xdr/Stellar-internal.x \
xdr/Stellar-contract-config-setting.x

XDRGEN_COMMIT=7c9349c62844e376bc637be678695387e88d125f # xdrgen commit to use, see https://github.com/stellar/xdrgen
XDRNEXT_COMMIT=6a620d160aab22609c982d54578ff6a63bfcdc01 # stellar-xdr commit to use, see https://github.com/stellar/stellar-xdr
# xdrgen commit to use, see https://github.com/stellar/xdrgen
XDRGEN_COMMIT=7c9349c62844e376bc637be678695387e88d125f
# stellar-xdr commit to use, see https://github.com/stellar/stellar-xdr
XDRNEXT_COMMIT=1a04392432dacc0092caaeae22a600ea1af3c6a5

.PHONY: xdr xdr-clean xdr-update

Expand Down
324 changes: 324 additions & 0 deletions src/main/java/org/stellar/sdk/xdr/ContractCodeCostInputs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
// Automatically generated by xdrgen
// DO NOT EDIT or your changes may be overwritten

package org.stellar.sdk.xdr;

import static org.stellar.sdk.xdr.Constants.*;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Objects;
import org.stellar.sdk.Base64Factory;

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

// struct ContractCodeCostInputs {
// ExtensionPoint ext;
// uint32 nInstructions;
// uint32 nFunctions;
// uint32 nGlobals;
// uint32 nTableEntries;
// uint32 nTypes;
// uint32 nDataSegments;
// uint32 nElemSegments;
// uint32 nImports;
// uint32 nExports;
// uint32 nDataSegmentBytes;
// };

// ===========================================================================
public class ContractCodeCostInputs implements XdrElement {
public ContractCodeCostInputs() {}

private ExtensionPoint ext;

public ExtensionPoint getExt() {
return this.ext;
}

public void setExt(ExtensionPoint value) {
this.ext = value;
}

private Uint32 nInstructions;

public Uint32 getNInstructions() {
return this.nInstructions;
}

public void setNInstructions(Uint32 value) {
this.nInstructions = value;
}

private Uint32 nFunctions;

public Uint32 getNFunctions() {
return this.nFunctions;
}

public void setNFunctions(Uint32 value) {
this.nFunctions = value;
}

private Uint32 nGlobals;

public Uint32 getNGlobals() {
return this.nGlobals;
}

public void setNGlobals(Uint32 value) {
this.nGlobals = value;
}

private Uint32 nTableEntries;

public Uint32 getNTableEntries() {
return this.nTableEntries;
}

public void setNTableEntries(Uint32 value) {
this.nTableEntries = value;
}

private Uint32 nTypes;

public Uint32 getNTypes() {
return this.nTypes;
}

public void setNTypes(Uint32 value) {
this.nTypes = value;
}

private Uint32 nDataSegments;

public Uint32 getNDataSegments() {
return this.nDataSegments;
}

public void setNDataSegments(Uint32 value) {
this.nDataSegments = value;
}

private Uint32 nElemSegments;

public Uint32 getNElemSegments() {
return this.nElemSegments;
}

public void setNElemSegments(Uint32 value) {
this.nElemSegments = value;
}

private Uint32 nImports;

public Uint32 getNImports() {
return this.nImports;
}

public void setNImports(Uint32 value) {
this.nImports = value;
}

private Uint32 nExports;

public Uint32 getNExports() {
return this.nExports;
}

public void setNExports(Uint32 value) {
this.nExports = value;
}

private Uint32 nDataSegmentBytes;

public Uint32 getNDataSegmentBytes() {
return this.nDataSegmentBytes;
}

public void setNDataSegmentBytes(Uint32 value) {
this.nDataSegmentBytes = value;
}

public static void encode(
XdrDataOutputStream stream, ContractCodeCostInputs encodedContractCodeCostInputs)
throws IOException {
ExtensionPoint.encode(stream, encodedContractCodeCostInputs.ext);
Uint32.encode(stream, encodedContractCodeCostInputs.nInstructions);
Uint32.encode(stream, encodedContractCodeCostInputs.nFunctions);
Uint32.encode(stream, encodedContractCodeCostInputs.nGlobals);
Uint32.encode(stream, encodedContractCodeCostInputs.nTableEntries);
Uint32.encode(stream, encodedContractCodeCostInputs.nTypes);
Uint32.encode(stream, encodedContractCodeCostInputs.nDataSegments);
Uint32.encode(stream, encodedContractCodeCostInputs.nElemSegments);
Uint32.encode(stream, encodedContractCodeCostInputs.nImports);
Uint32.encode(stream, encodedContractCodeCostInputs.nExports);
Uint32.encode(stream, encodedContractCodeCostInputs.nDataSegmentBytes);
}

public void encode(XdrDataOutputStream stream) throws IOException {
encode(stream, this);
}

public static ContractCodeCostInputs decode(XdrDataInputStream stream) throws IOException {
ContractCodeCostInputs decodedContractCodeCostInputs = new ContractCodeCostInputs();
decodedContractCodeCostInputs.ext = ExtensionPoint.decode(stream);
decodedContractCodeCostInputs.nInstructions = Uint32.decode(stream);
decodedContractCodeCostInputs.nFunctions = Uint32.decode(stream);
decodedContractCodeCostInputs.nGlobals = Uint32.decode(stream);
decodedContractCodeCostInputs.nTableEntries = Uint32.decode(stream);
decodedContractCodeCostInputs.nTypes = Uint32.decode(stream);
decodedContractCodeCostInputs.nDataSegments = Uint32.decode(stream);
decodedContractCodeCostInputs.nElemSegments = Uint32.decode(stream);
decodedContractCodeCostInputs.nImports = Uint32.decode(stream);
decodedContractCodeCostInputs.nExports = Uint32.decode(stream);
decodedContractCodeCostInputs.nDataSegmentBytes = Uint32.decode(stream);
return decodedContractCodeCostInputs;
}

@Override
public int hashCode() {
return Objects.hash(
this.ext,
this.nInstructions,
this.nFunctions,
this.nGlobals,
this.nTableEntries,
this.nTypes,
this.nDataSegments,
this.nElemSegments,
this.nImports,
this.nExports,
this.nDataSegmentBytes);
}

@Override
public boolean equals(Object object) {
if (!(object instanceof ContractCodeCostInputs)) {
return false;
}

ContractCodeCostInputs other = (ContractCodeCostInputs) object;
return Objects.equals(this.ext, other.ext)
&& Objects.equals(this.nInstructions, other.nInstructions)
&& Objects.equals(this.nFunctions, other.nFunctions)
&& Objects.equals(this.nGlobals, other.nGlobals)
&& Objects.equals(this.nTableEntries, other.nTableEntries)
&& Objects.equals(this.nTypes, other.nTypes)
&& Objects.equals(this.nDataSegments, other.nDataSegments)
&& Objects.equals(this.nElemSegments, other.nElemSegments)
&& Objects.equals(this.nImports, other.nImports)
&& Objects.equals(this.nExports, other.nExports)
&& Objects.equals(this.nDataSegmentBytes, other.nDataSegmentBytes);
}

@Override
public String toXdrBase64() throws IOException {
return Base64Factory.getInstance().encodeToString(toXdrByteArray());
}

@Override
public byte[] toXdrByteArray() throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
XdrDataOutputStream xdrDataOutputStream = new XdrDataOutputStream(byteArrayOutputStream);
encode(xdrDataOutputStream);
return byteArrayOutputStream.toByteArray();
}

public static ContractCodeCostInputs fromXdrBase64(String xdr) throws IOException {
byte[] bytes = Base64Factory.getInstance().decode(xdr);
return fromXdrByteArray(bytes);
}

public static ContractCodeCostInputs fromXdrByteArray(byte[] xdr) throws IOException {
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(xdr);
XdrDataInputStream xdrDataInputStream = new XdrDataInputStream(byteArrayInputStream);
return decode(xdrDataInputStream);
}

public static final class Builder {
private ExtensionPoint ext;
private Uint32 nInstructions;
private Uint32 nFunctions;
private Uint32 nGlobals;
private Uint32 nTableEntries;
private Uint32 nTypes;
private Uint32 nDataSegments;
private Uint32 nElemSegments;
private Uint32 nImports;
private Uint32 nExports;
private Uint32 nDataSegmentBytes;

public Builder ext(ExtensionPoint ext) {
this.ext = ext;
return this;
}

public Builder nInstructions(Uint32 nInstructions) {
this.nInstructions = nInstructions;
return this;
}

public Builder nFunctions(Uint32 nFunctions) {
this.nFunctions = nFunctions;
return this;
}

public Builder nGlobals(Uint32 nGlobals) {
this.nGlobals = nGlobals;
return this;
}

public Builder nTableEntries(Uint32 nTableEntries) {
this.nTableEntries = nTableEntries;
return this;
}

public Builder nTypes(Uint32 nTypes) {
this.nTypes = nTypes;
return this;
}

public Builder nDataSegments(Uint32 nDataSegments) {
this.nDataSegments = nDataSegments;
return this;
}

public Builder nElemSegments(Uint32 nElemSegments) {
this.nElemSegments = nElemSegments;
return this;
}

public Builder nImports(Uint32 nImports) {
this.nImports = nImports;
return this;
}

public Builder nExports(Uint32 nExports) {
this.nExports = nExports;
return this;
}

public Builder nDataSegmentBytes(Uint32 nDataSegmentBytes) {
this.nDataSegmentBytes = nDataSegmentBytes;
return this;
}

public ContractCodeCostInputs build() {
ContractCodeCostInputs val = new ContractCodeCostInputs();
val.setExt(this.ext);
val.setNInstructions(this.nInstructions);
val.setNFunctions(this.nFunctions);
val.setNGlobals(this.nGlobals);
val.setNTableEntries(this.nTableEntries);
val.setNTypes(this.nTypes);
val.setNDataSegments(this.nDataSegments);
val.setNElemSegments(this.nElemSegments);
val.setNImports(this.nImports);
val.setNExports(this.nExports);
val.setNDataSegmentBytes(this.nDataSegmentBytes);
return val;
}
}
}
Loading

0 comments on commit b5f0773

Please sign in to comment.