From 6f17c4116aef89c34a81f2b0309b10cb7d0943e1 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Tue, 12 Apr 2022 19:13:16 -0400 Subject: [PATCH 1/3] lang: fix missing skip serialize for idl instruction --- CHANGELOG.md | 4 ++++ lang/syn/src/idl/mod.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca49e58437..955cb89e04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ The minor version will be incremented upon a breaking change and the patch versi ## [Unreleased] +### Fixes + +* lang: Fix `returns` being serialized as `null` instead of `undefined` ([]()). + ## [0.24.1] - 2022-04-12 ### Fixes diff --git a/lang/syn/src/idl/mod.rs b/lang/syn/src/idl/mod.rs index a92d9baa1b..50bafb8953 100644 --- a/lang/syn/src/idl/mod.rs +++ b/lang/syn/src/idl/mod.rs @@ -45,6 +45,7 @@ pub struct IdlInstruction { pub name: String, pub accounts: Vec, pub args: Vec, + #[serde(skip_serializing_if = "Option::is_none")] pub returns: Option, } From 15041db25e8ad50a724c92626b3ef0fb569416e3 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Tue, 12 Apr 2022 19:13:56 -0400 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 955cb89e04..169ea8893f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ The minor version will be incremented upon a breaking change and the patch versi ### Fixes -* lang: Fix `returns` being serialized as `null` instead of `undefined` ([]()). +* lang: Fix `returns` being serialized as `null` instead of `undefined` ([#1782](https://github.com/project-serum/anchor/pull/1782)). ## [0.24.1] - 2022-04-12 From 6d9292492e4cd32a635ea25ae82c23fb52834361 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Tue, 12 Apr 2022 19:35:35 -0400 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 169ea8893f..d6932d44fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ The minor version will be incremented upon a breaking change and the patch versi ### Fixes -* lang: Fix `returns` being serialized as `null` instead of `undefined` ([#1782](https://github.com/project-serum/anchor/pull/1782)). +* lang: Fix `returns` being serialized as `null` instead of `undefined` in IDL ([#1782](https://github.com/project-serum/anchor/pull/1782)). ## [0.24.1] - 2022-04-12