Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lang/src/accounts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

pub mod account;
pub mod account_info;
pub mod account_loader;
pub mod boxed;
#[doc(hidden)]
#[allow(deprecated)]
Expand All @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion lang/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions lang/syn/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -414,7 +414,7 @@ pub enum Ty {
CpiState(CpiStateTy),
ProgramAccount(ProgramAccountTy),
Loader(LoaderTy),
AccountLoader(LoaderAccountTy),
AccountLoader(AccountLoaderTy),
CpiAccount(CpiAccountTy),
Sysvar(SysvarTy),
Account(AccountTy),
Expand Down Expand Up @@ -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,
}
Expand Down
6 changes: 3 additions & 3 deletions lang/syn/src/parser/accounts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
})
}
Expand Down