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

Bump XDR definitions #5289

Merged
merged 1 commit into from
Apr 24, 2024
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ XDRS = $(DOWNLOADABLE_XDRS) xdr/Stellar-lighthorizon.x \


XDRGEN_COMMIT=e2cac557162d99b12ae73b846cf3d5bfe16636de
XDR_COMMIT=2ba4049554bb0564950e6d9213e01a60fc190f54
XDR_COMMIT=1a04392432dacc0092caaeae22a600ea1af3c6a5

.PHONY: xdr xdr-clean xdr-update

Expand Down
48 changes: 1 addition & 47 deletions gxdr/xdr_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions xdr/Stellar-contract-spec.x
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ enum SCSpecType
SC_SPEC_TYPE_MAP = 1004,
SC_SPEC_TYPE_TUPLE = 1005,
SC_SPEC_TYPE_BYTES_N = 1006,
SC_SPEC_TYPE_HASH = 1007,

// User defined types.
SC_SPEC_TYPE_UDT = 2000
Expand Down Expand Up @@ -80,11 +79,6 @@ struct SCSpecTypeBytesN
uint32 n;
};

struct SCSpectTypeHash
{
uint32 n;
};

struct SCSpecTypeUDT
{
string name<60>;
Expand Down Expand Up @@ -123,8 +117,6 @@ case SC_SPEC_TYPE_TUPLE:
SCSpecTypeTuple tuple;
case SC_SPEC_TYPE_BYTES_N:
SCSpecTypeBytesN bytesN;
case SC_SPEC_TYPE_HASH:
SCSpectTypeHash hash;
case SC_SPEC_TYPE_UDT:
SCSpecTypeUDT udt;
};
Expand Down
2 changes: 1 addition & 1 deletion xdr/xdr_commit_generated.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2ba4049554bb0564950e6d9213e01a60fc190f54
1a04392432dacc0092caaeae22a600ea1af3c6a5
120 changes: 1 addition & 119 deletions xdr/xdr_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var XdrFilesSHA256 = map[string]string{
"xdr/Stellar-contract-config-setting.x": "393369678663cb0f9471a0b69e2a9cfa3ac93c4415fa40cec166e9a231ecbe0d",
"xdr/Stellar-contract-env-meta.x": "928a30de814ee589bc1d2aadd8dd81c39f71b7e6f430f56974505ccb1f49654b",
"xdr/Stellar-contract-meta.x": "f01532c11ca044e19d9f9f16fe373e9af64835da473be556b9a807ee3319ae0d",
"xdr/Stellar-contract-spec.x": "8d7f6bdd82c3e529cd8c6f035202ca0e7677cc05e4727492a165dfdc51a9cb3e",
"xdr/Stellar-contract-spec.x": "c7ffa21d2e91afb8e666b33524d307955426ff553a486d670c29217ed9888d49",
"xdr/Stellar-contract.x": "7f665e4103e146a88fcdabce879aaaacd3bf9283feb194cc47ff986264c1e315",
"xdr/Stellar-exporter.x": "a00c83d02e8c8382e06f79a191f1fb5abd097a4bbcab8481c67467e3270e0529",
"xdr/Stellar-internal.x": "227835866c1b2122d1eaf28839ba85ea7289d1cb681dda4ca619c2da3d71fe00",
Expand Down Expand Up @@ -48095,7 +48095,6 @@ const ScSpecDocLimit = 1024
// SC_SPEC_TYPE_MAP = 1004,
// SC_SPEC_TYPE_TUPLE = 1005,
// SC_SPEC_TYPE_BYTES_N = 1006,
// SC_SPEC_TYPE_HASH = 1007,
//
// // User defined types.
// SC_SPEC_TYPE_UDT = 2000
Expand Down Expand Up @@ -48127,7 +48126,6 @@ const (
ScSpecTypeScSpecTypeMap ScSpecType = 1004
ScSpecTypeScSpecTypeTuple ScSpecType = 1005
ScSpecTypeScSpecTypeBytesN ScSpecType = 1006
ScSpecTypeScSpecTypeHash ScSpecType = 1007
ScSpecTypeScSpecTypeUdt ScSpecType = 2000
)

Expand Down Expand Up @@ -48156,7 +48154,6 @@ var scSpecTypeMap = map[int32]string{
1004: "ScSpecTypeScSpecTypeMap",
1005: "ScSpecTypeScSpecTypeTuple",
1006: "ScSpecTypeScSpecTypeBytesN",
1007: "ScSpecTypeScSpecTypeHash",
2000: "ScSpecTypeScSpecTypeUdt",
}

Expand Down Expand Up @@ -48662,71 +48659,6 @@ func (s ScSpecTypeBytesN) xdrType() {}

var _ xdrType = (*ScSpecTypeBytesN)(nil)

// ScSpectTypeHash is an XDR Struct defines as:
//
// struct SCSpectTypeHash
// {
// uint32 n;
// };
type ScSpectTypeHash struct {
N Uint32
}

// EncodeTo encodes this value using the Encoder.
func (s *ScSpectTypeHash) EncodeTo(e *xdr.Encoder) error {
var err error
if err = s.N.EncodeTo(e); err != nil {
return err
}
return nil
}

var _ decoderFrom = (*ScSpectTypeHash)(nil)

// DecodeFrom decodes this value using the Decoder.
func (s *ScSpectTypeHash) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error) {
if maxDepth == 0 {
return 0, fmt.Errorf("decoding ScSpectTypeHash: %w", ErrMaxDecodingDepthReached)
}
maxDepth -= 1
var err error
var n, nTmp int
nTmp, err = s.N.DecodeFrom(d, maxDepth)
n += nTmp
if err != nil {
return n, fmt.Errorf("decoding Uint32: %w", err)
}
return n, nil
}

// MarshalBinary implements encoding.BinaryMarshaler.
func (s ScSpectTypeHash) MarshalBinary() ([]byte, error) {
b := bytes.Buffer{}
e := xdr.NewEncoder(&b)
err := s.EncodeTo(e)
return b.Bytes(), err
}

// UnmarshalBinary implements encoding.BinaryUnmarshaler.
func (s *ScSpectTypeHash) UnmarshalBinary(inp []byte) error {
r := bytes.NewReader(inp)
o := xdr.DefaultDecodeOptions
o.MaxInputLen = len(inp)
d := xdr.NewDecoderWithOptions(r, o)
_, err := s.DecodeFrom(d, o.MaxDepth)
return err
}

var (
_ encoding.BinaryMarshaler = (*ScSpectTypeHash)(nil)
_ encoding.BinaryUnmarshaler = (*ScSpectTypeHash)(nil)
)

// xdrType signals that this type represents XDR values defined by this package.
func (s ScSpectTypeHash) xdrType() {}

var _ xdrType = (*ScSpectTypeHash)(nil)

// ScSpecTypeUdt is an XDR Struct defines as:
//
// struct SCSpecTypeUDT
Expand Down Expand Up @@ -48827,8 +48759,6 @@ var _ xdrType = (*ScSpecTypeUdt)(nil)
// SCSpecTypeTuple tuple;
// case SC_SPEC_TYPE_BYTES_N:
// SCSpecTypeBytesN bytesN;
// case SC_SPEC_TYPE_HASH:
// SCSpectTypeHash hash;
// case SC_SPEC_TYPE_UDT:
// SCSpecTypeUDT udt;
// };
Expand All @@ -48840,7 +48770,6 @@ type ScSpecTypeDef struct {
Map *ScSpecTypeMap
Tuple *ScSpecTypeTuple
BytesN *ScSpecTypeBytesN
Hash *ScSpectTypeHash
Udt *ScSpecTypeUdt
}

Expand Down Expand Up @@ -48902,8 +48831,6 @@ func (u ScSpecTypeDef) ArmForSwitch(sw int32) (string, bool) {
return "Tuple", true
case ScSpecTypeScSpecTypeBytesN:
return "BytesN", true
case ScSpecTypeScSpecTypeHash:
return "Hash", true
case ScSpecTypeScSpecTypeUdt:
return "Udt", true
}
Expand Down Expand Up @@ -48992,13 +48919,6 @@ func NewScSpecTypeDef(aType ScSpecType, value interface{}) (result ScSpecTypeDef
return
}
result.BytesN = &tv
case ScSpecTypeScSpecTypeHash:
tv, ok := value.(ScSpectTypeHash)
if !ok {
err = errors.New("invalid value, must be ScSpectTypeHash")
return
}
result.Hash = &tv
case ScSpecTypeScSpecTypeUdt:
tv, ok := value.(ScSpecTypeUdt)
if !ok {
Expand Down Expand Up @@ -49160,31 +49080,6 @@ func (u ScSpecTypeDef) GetBytesN() (result ScSpecTypeBytesN, ok bool) {
return
}

// MustHash retrieves the Hash value from the union,
// panicing if the value is not set.
func (u ScSpecTypeDef) MustHash() ScSpectTypeHash {
val, ok := u.GetHash()

if !ok {
panic("arm Hash is not set")
}

return val
}

// GetHash retrieves the Hash value from the union,
// returning ok if the union's switch indicated the value is valid.
func (u ScSpecTypeDef) GetHash() (result ScSpectTypeHash, ok bool) {
armName, _ := u.ArmForSwitch(int32(u.Type))

if armName == "Hash" {
result = *u.Hash
ok = true
}

return
}

// MustUdt retrieves the Udt value from the union,
// panicing if the value is not set.
func (u ScSpecTypeDef) MustUdt() ScSpecTypeUdt {
Expand Down Expand Up @@ -49301,11 +49196,6 @@ func (u ScSpecTypeDef) EncodeTo(e *xdr.Encoder) error {
return err
}
return nil
case ScSpecTypeScSpecTypeHash:
if err = (*u.Hash).EncodeTo(e); err != nil {
return err
}
return nil
case ScSpecTypeScSpecTypeUdt:
if err = (*u.Udt).EncodeTo(e); err != nil {
return err
Expand Down Expand Up @@ -49433,14 +49323,6 @@ func (u *ScSpecTypeDef) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error) {
return n, fmt.Errorf("decoding ScSpecTypeBytesN: %w", err)
}
return n, nil
case ScSpecTypeScSpecTypeHash:
u.Hash = new(ScSpectTypeHash)
nTmp, err = (*u.Hash).DecodeFrom(d, maxDepth)
n += nTmp
if err != nil {
return n, fmt.Errorf("decoding ScSpectTypeHash: %w", err)
}
return n, nil
case ScSpecTypeScSpecTypeUdt:
u.Udt = new(ScSpecTypeUdt)
nTmp, err = (*u.Udt).DecodeFrom(d, maxDepth)
Expand Down
Loading