lang: rename loader_account.rs to account_loader.rs (#1279)

This commit is contained in:
Paul 2022-01-10 20:39:24 +01:00 committed by GitHub
parent 4422902e86
commit 0dfed11eaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 9 deletions

View File

@ -13,13 +13,14 @@ incremented for features.
### 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)).
## [0.20.1] - 2022-01-09
### Fixes
*lang: Improved error msgs when required programs are missing when using the `init` constraint([#1257](https://github.com/project-serum/anchor/pull/1257))
* lang: Improved error msgs when required programs are missing when using the `init` constraint([#1257](https://github.com/project-serum/anchor/pull/1257))
### Features

View File

@ -2,6 +2,7 @@
pub mod account;
pub mod account_info;
pub mod account_loader;
pub mod boxed;
#[doc(hidden)]
#[allow(deprecated)]
@ -12,7 +13,6 @@ pub mod cpi_state;
#[doc(hidden)]
#[allow(deprecated)]
pub mod loader;
pub mod loader_account;
pub mod program;
#[doc(hidden)]
#[allow(deprecated)]

View File

@ -235,7 +235,7 @@ where
pub mod prelude {
pub use super::{
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::sysvar::Sysvar, accounts::unchecked_account::UncheckedAccount, constant,
context::Context, context::CpiContext, declare_id, emit, error, event, interface, program,

View File

@ -294,7 +294,7 @@ impl Field {
anchor_lang::accounts::account::Account
},
Ty::AccountLoader(_) => quote! {
anchor_lang::accounts::loader_account::AccountLoader
anchor_lang::accounts::account_loader::AccountLoader
},
Ty::Loader(_) => quote! {
anchor_lang::accounts::loader::Loader
@ -414,7 +414,7 @@ pub enum Ty {
CpiState(CpiStateTy),
ProgramAccount(ProgramAccountTy),
Loader(LoaderTy),
AccountLoader(LoaderAccountTy),
AccountLoader(AccountLoaderTy),
CpiAccount(CpiAccountTy),
Sysvar(SysvarTy),
Account(AccountTy),
@ -461,7 +461,7 @@ pub struct CpiAccountTy {
}
#[derive(Debug, PartialEq)]
pub struct LoaderAccountTy {
pub struct AccountLoaderTy {
// The struct type of the account.
pub account_type_path: TypePath,
}

View File

@ -160,7 +160,7 @@ fn parse_ty(f: &syn::Field) -> ParseResult<Ty> {
"AccountInfo" => Ty::AccountInfo,
"UncheckedAccount" => Ty::UncheckedAccount,
"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)?),
"Program" => Ty::Program(parse_program_ty(&path)?),
"Signer" => Ty::Signer,
@ -229,9 +229,9 @@ fn parse_program_account_zero_copy(path: &syn::Path) -> ParseResult<LoaderTy> {
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)?;
Ok(LoaderAccountTy {
Ok(AccountLoaderTy {
account_type_path: account_ident,
})
}