From e5f77b376b559441100e78fbe23dc0b5a28ae787 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Mon, 10 Jan 2022 01:31:21 +0100 Subject: [PATCH 1/3] lang: rename loader_account.rs to account_loader.rs --- lang/src/accounts/{loader_account.rs => account_loader.rs} | 0 lang/src/accounts/mod.rs | 2 +- lang/src/lib.rs | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename lang/src/accounts/{loader_account.rs => account_loader.rs} (100%) diff --git a/lang/src/accounts/loader_account.rs b/lang/src/accounts/account_loader.rs similarity index 100% rename from lang/src/accounts/loader_account.rs rename to lang/src/accounts/account_loader.rs diff --git a/lang/src/accounts/mod.rs b/lang/src/accounts/mod.rs index 6bcd69f495..8839ef35a2 100644 --- a/lang/src/accounts/mod.rs +++ b/lang/src/accounts/mod.rs @@ -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)] diff --git a/lang/src/lib.rs b/lang/src/lib.rs index 9af3596d15..9f7fcbe71e 100644 --- a/lang/src/lib.rs +++ b/lang/src/lib.rs @@ -220,7 +220,7 @@ impl Key for Pubkey { 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, From c310712e3ba218b578fa5a8b10323cc98134c54e Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Mon, 10 Jan 2022 01:34:07 +0100 Subject: [PATCH 2/3] docs: update changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5a599e76b..adbcaa3b97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,11 +11,15 @@ incremented for features. ## [Unreleased] +### Breaking + +* lang: rename `loader_account` module to `account_loader` module ([#1279](https://github.com/project-serum/anchor/pull/1279)) + ## [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 From 02cb459d891bf81ac089c94c1e398a6558f3631a Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Mon, 10 Jan 2022 10:53:14 +0100 Subject: [PATCH 3/3] lang: fix missing renames --- lang/syn/src/lib.rs | 6 +++--- lang/syn/src/parser/accounts/mod.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lang/syn/src/lib.rs b/lang/syn/src/lib.rs index 038d22d3e4..eff1bbc6fc 100644 --- a/lang/syn/src/lib.rs +++ b/lang/syn/src/lib.rs @@ -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, } diff --git a/lang/syn/src/parser/accounts/mod.rs b/lang/syn/src/parser/accounts/mod.rs index 2f92212d35..02eb22b4e7 100644 --- a/lang/syn/src/parser/accounts/mod.rs +++ b/lang/syn/src/parser/accounts/mod.rs @@ -160,7 +160,7 @@ fn parse_ty(f: &syn::Field) -> ParseResult { "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 { account_type_path: account_ident, }) } -fn parse_program_loader_account(path: &syn::Path) -> ParseResult { +fn parse_program_account_loader(path: &syn::Path) -> ParseResult { let account_ident = parse_account(path)?; - Ok(LoaderAccountTy { + Ok(AccountLoaderTy { account_type_path: account_ident, }) }