Skip to content

Commit

Permalink
Fix XDR bool encoding/decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Mar 22, 2023
1 parent a5f3278 commit c099b71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ xdr/Stellar-contract-spec.x \
xdr/Stellar-contract.x \
xdr/Stellar-internal.x

XDRGEN_COMMIT=57beb46bd3d1c77529218430bd6ed87cd69ac394
XDRGEN_COMMIT=944c83a772fcc85503f626cfea70e4716bc212ba
XDRNEXT_COMMIT=7356dc237ee0db5626561c129fb3fa4beaabbac6

.PHONY: xdr xdr-clean xdr-update
Expand Down
8 changes: 4 additions & 4 deletions xdr/xdr_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c099b71

Please sign in to comment.