From 1adb6a2c47fd4280ed4c2b591140e1a77c01ea89 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 12 Apr 2022 19:35:57 -0400 Subject: [PATCH] lang: fix missing skip serialize for idl instruction (#1782) --- 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..d6932d44fb 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` in IDL ([#1782](https://github.com/project-serum/anchor/pull/1782)). + ## [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, }