From b84af1e7259b34977c08b48754fe08d8aab7ef62 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 22 Mar 2023 13:39:51 +0100 Subject: [PATCH 1/2] Fix XDR bool encoding/decoding --- Makefile | 2 +- xdr/xdr_generated.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 8a7dea9e87..b1bde3c35e 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ xdr/Stellar-contract-spec.x \ xdr/Stellar-contract.x \ xdr/Stellar-internal.x -XDRGEN_COMMIT=57beb46bd3d1c77529218430bd6ed87cd69ac394 +XDRGEN_COMMIT=9cbdfbe94ced89d9728f8706225ac86fc45705bc XDRNEXT_COMMIT=7356dc237ee0db5626561c129fb3fa4beaabbac6 .PHONY: xdr xdr-clean xdr-update diff --git a/xdr/xdr_generated.go b/xdr/xdr_generated.go index e0963e5fcd..4feb1150c7 100644 --- a/xdr/xdr_generated.go +++ b/xdr/xdr_generated.go @@ -15873,7 +15873,7 @@ type DiagnosticEvent struct { // EncodeTo encodes this value using the Encoder. func (s *DiagnosticEvent) EncodeTo(e *xdr.Encoder) error { var err error - if _, err = e.Encode(s.InSuccessfulContractCall); err != nil { + if _, err = e.EncodeBool(bool(s.InSuccessfulContractCall)); err != nil { return err } if err = s.Event.EncodeTo(e); err != nil { @@ -15888,7 +15888,7 @@ var _ decoderFrom = (*DiagnosticEvent)(nil) func (s *DiagnosticEvent) DecodeFrom(d *xdr.Decoder) (int, error) { var err error var n, nTmp int - nTmp, err = d.Decode(s.InSuccessfulContractCall) + s.InSuccessfulContractCall, nTmp, err = d.DecodeBool() n += nTmp if err != nil { return n, fmt.Errorf("decoding Bool: %s", err) @@ -50913,7 +50913,7 @@ func (u ScVal) EncodeTo(e *xdr.Encoder) error { } switch ScValType(u.Type) { case ScValTypeScvBool: - if _, err = e.Encode((*u.B)); err != nil { + if _, err = e.EncodeBool(bool((*u.B))); err != nil { return err } return nil @@ -51046,7 +51046,7 @@ func (u *ScVal) DecodeFrom(d *xdr.Decoder) (int, error) { switch ScValType(u.Type) { case ScValTypeScvBool: u.B = new(bool) - nTmp, err = d.Decode(u.B) + (*u.B), nTmp, err = d.DecodeBool() n += nTmp if err != nil { return n, fmt.Errorf("decoding Bool: %s", err) From 777652f2ef022ba48bbeab229a6a228f001926a6 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 22 Mar 2023 14:40:02 +0100 Subject: [PATCH 2/2] Bump xdrgen commit now that it was merged --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b1bde3c35e..ba7fc5ac13 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ xdr/Stellar-contract-spec.x \ xdr/Stellar-contract.x \ xdr/Stellar-internal.x -XDRGEN_COMMIT=9cbdfbe94ced89d9728f8706225ac86fc45705bc +XDRGEN_COMMIT=80e38ef2a96489f6b501d4db3a350406e5aa3bab XDRNEXT_COMMIT=7356dc237ee0db5626561c129fb3fa4beaabbac6 .PHONY: xdr xdr-clean xdr-update