lang: rename loader_account.rs to account_loader.rs (#1279)
This commit is contained in:
parent
4422902e86
commit
0dfed11eaa
|
@ -13,6 +13,7 @@ incremented for features.
|
||||||
|
|
||||||
### Breaking
|
### Breaking
|
||||||
|
|
||||||
|
* lang: rename `loader_account` module to `account_loader` module ([#1279](https://github.com/project-serum/anchor/pull/1279))
|
||||||
* ts: `Coder` is now an interface and the existing class has been renamed to `BorshCoder`. This change allows the generation of Anchor clients for non anchor programs ([#1259](https://github.com/project-serum/anchor/pull/1259/files)).
|
* ts: `Coder` is now an interface and the existing class has been renamed to `BorshCoder`. This change allows the generation of Anchor clients for non anchor programs ([#1259](https://github.com/project-serum/anchor/pull/1259/files)).
|
||||||
|
|
||||||
## [0.20.1] - 2022-01-09
|
## [0.20.1] - 2022-01-09
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
pub mod account;
|
pub mod account;
|
||||||
pub mod account_info;
|
pub mod account_info;
|
||||||
|
pub mod account_loader;
|
||||||
pub mod boxed;
|
pub mod boxed;
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
|
@ -12,7 +13,6 @@ pub mod cpi_state;
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
pub mod loader;
|
pub mod loader;
|
||||||
pub mod loader_account;
|
|
||||||
pub mod program;
|
pub mod program;
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
|
|
|
@ -235,7 +235,7 @@ where
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
pub use super::{
|
pub use super::{
|
||||||
access_control, account, accounts::account::Account,
|
access_control, account, accounts::account::Account,
|
||||||
accounts::loader_account::AccountLoader, accounts::program::Program,
|
accounts::account_loader::AccountLoader, accounts::program::Program,
|
||||||
accounts::signer::Signer, accounts::system_account::SystemAccount,
|
accounts::signer::Signer, accounts::system_account::SystemAccount,
|
||||||
accounts::sysvar::Sysvar, accounts::unchecked_account::UncheckedAccount, constant,
|
accounts::sysvar::Sysvar, accounts::unchecked_account::UncheckedAccount, constant,
|
||||||
context::Context, context::CpiContext, declare_id, emit, error, event, interface, program,
|
context::Context, context::CpiContext, declare_id, emit, error, event, interface, program,
|
||||||
|
|
|
@ -294,7 +294,7 @@ impl Field {
|
||||||
anchor_lang::accounts::account::Account
|
anchor_lang::accounts::account::Account
|
||||||
},
|
},
|
||||||
Ty::AccountLoader(_) => quote! {
|
Ty::AccountLoader(_) => quote! {
|
||||||
anchor_lang::accounts::loader_account::AccountLoader
|
anchor_lang::accounts::account_loader::AccountLoader
|
||||||
},
|
},
|
||||||
Ty::Loader(_) => quote! {
|
Ty::Loader(_) => quote! {
|
||||||
anchor_lang::accounts::loader::Loader
|
anchor_lang::accounts::loader::Loader
|
||||||
|
@ -414,7 +414,7 @@ pub enum Ty {
|
||||||
CpiState(CpiStateTy),
|
CpiState(CpiStateTy),
|
||||||
ProgramAccount(ProgramAccountTy),
|
ProgramAccount(ProgramAccountTy),
|
||||||
Loader(LoaderTy),
|
Loader(LoaderTy),
|
||||||
AccountLoader(LoaderAccountTy),
|
AccountLoader(AccountLoaderTy),
|
||||||
CpiAccount(CpiAccountTy),
|
CpiAccount(CpiAccountTy),
|
||||||
Sysvar(SysvarTy),
|
Sysvar(SysvarTy),
|
||||||
Account(AccountTy),
|
Account(AccountTy),
|
||||||
|
@ -461,7 +461,7 @@ pub struct CpiAccountTy {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub struct LoaderAccountTy {
|
pub struct AccountLoaderTy {
|
||||||
// The struct type of the account.
|
// The struct type of the account.
|
||||||
pub account_type_path: TypePath,
|
pub account_type_path: TypePath,
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ fn parse_ty(f: &syn::Field) -> ParseResult<Ty> {
|
||||||
"AccountInfo" => Ty::AccountInfo,
|
"AccountInfo" => Ty::AccountInfo,
|
||||||
"UncheckedAccount" => Ty::UncheckedAccount,
|
"UncheckedAccount" => Ty::UncheckedAccount,
|
||||||
"Loader" => Ty::Loader(parse_program_account_zero_copy(&path)?),
|
"Loader" => Ty::Loader(parse_program_account_zero_copy(&path)?),
|
||||||
"AccountLoader" => Ty::AccountLoader(parse_program_loader_account(&path)?),
|
"AccountLoader" => Ty::AccountLoader(parse_program_account_loader(&path)?),
|
||||||
"Account" => Ty::Account(parse_account_ty(&path)?),
|
"Account" => Ty::Account(parse_account_ty(&path)?),
|
||||||
"Program" => Ty::Program(parse_program_ty(&path)?),
|
"Program" => Ty::Program(parse_program_ty(&path)?),
|
||||||
"Signer" => Ty::Signer,
|
"Signer" => Ty::Signer,
|
||||||
|
@ -229,9 +229,9 @@ fn parse_program_account_zero_copy(path: &syn::Path) -> ParseResult<LoaderTy> {
|
||||||
account_type_path: account_ident,
|
account_type_path: account_ident,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
fn parse_program_loader_account(path: &syn::Path) -> ParseResult<LoaderAccountTy> {
|
fn parse_program_account_loader(path: &syn::Path) -> ParseResult<AccountLoaderTy> {
|
||||||
let account_ident = parse_account(path)?;
|
let account_ident = parse_account(path)?;
|
||||||
Ok(LoaderAccountTy {
|
Ok(AccountLoaderTy {
|
||||||
account_type_path: account_ident,
|
account_type_path: account_ident,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue