ソースを参照

lang: fix missing skip serialize for idl instruction (#1782)

Paul 3 年 前
コミット
1adb6a2c47
2 ファイル変更5 行追加0 行削除
  1. 4 0
      CHANGELOG.md
  2. 1 0
      lang/syn/src/idl/mod.rs

+ 4 - 0
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

+ 1 - 0
lang/syn/src/idl/mod.rs

@@ -45,6 +45,7 @@ pub struct IdlInstruction {
     pub name: String,
     pub accounts: Vec<IdlAccountItem>,
     pub args: Vec<IdlField>,
+    #[serde(skip_serializing_if = "Option::is_none")]
     pub returns: Option<IdlType>,
 }