Ver código fonte

lang: Fix idl for Signer type (#750)

Armani Ferrante 4 anos atrás
pai
commit
bbf79e7d7e
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      lang/syn/src/idl/file.rs

+ 5 - 1
lang/syn/src/idl/file.rs

@@ -1,6 +1,7 @@
 use crate::idl::*;
 use crate::parser::context::CrateContext;
 use crate::parser::{self, accounts, error, program};
+use crate::Ty;
 use crate::{AccountField, AccountsStruct, StateIx};
 use anyhow::Result;
 use heck::MixedCase;
@@ -458,7 +459,10 @@ fn idl_accounts(
             AccountField::Field(acc) => IdlAccountItem::IdlAccount(IdlAccount {
                 name: acc.ident.to_string().to_mixed_case(),
                 is_mut: acc.constraints.is_mutable(),
-                is_signer: acc.constraints.is_signer(),
+                is_signer: match acc.ty {
+                    Ty::Signer => true,
+                    _ => acc.constraints.is_signer(),
+                },
             }),
         })
         .collect::<Vec<_>>()