From 200d9c86b7ce14b116afe89eb0bb82bfa0430398 Mon Sep 17 00:00:00 2001 From: newmanifold Date: Fri, 27 Dec 2024 13:53:44 +0100 Subject: [PATCH 1/2] Fix: UnmarshalWithDecoder method reciever type in GetParsedTransactionResult --- rpc/getParsedTransaction.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/getParsedTransaction.go b/rpc/getParsedTransaction.go index a2dbe53e..5456a6c3 100644 --- a/rpc/getParsedTransaction.go +++ b/rpc/getParsedTransaction.go @@ -131,7 +131,7 @@ func (obj GetParsedTransactionResult) MarshalWithEncoder(encoder *bin.Encoder) ( return nil } -func (obj GetParsedTransactionResult) UnmarshalWithDecoder(decoder *bin.Decoder) (err error) { +func (obj *GetParsedTransactionResult) UnmarshalWithDecoder(decoder *bin.Decoder) (err error) { // Deserialize `Slot`: obj.Slot, err = decoder.ReadUint64(bin.LE) if err != nil { From 729bec32a9fcb2353cfbc1a10a6d5abafd9c4b46 Mon Sep 17 00:00:00 2001 From: newmanifold Date: Fri, 27 Dec 2024 13:54:05 +0100 Subject: [PATCH 2/2] Added version information in MarshalWithEncoder, UnmarshalWithDecoder methods of GetTransactionResult --- rpc/getTransaction.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rpc/getTransaction.go b/rpc/getTransaction.go index 54f7522f..ea42ae22 100644 --- a/rpc/getTransaction.go +++ b/rpc/getTransaction.go @@ -231,6 +231,16 @@ func (obj GetTransactionResult) MarshalWithEncoder(encoder *bin.Encoder) (err er } } } + { + buf, err := json.Marshal(obj.Version) + if err != nil { + return err + } + err = encoder.WriteBytes(buf, true) + if err != nil { + return err + } + } return nil } @@ -283,5 +293,15 @@ func (obj *GetTransactionResult) UnmarshalWithDecoder(decoder *bin.Decoder) (err } } } + { + buf, err := decoder.ReadByteSlice() + if err != nil { + return err + } + err = json.Unmarshal(buf, &obj.Version) + if err != nil { + return err + } + } return nil }