From 5bf51d5d872a9d661096ab747e550e2df0c0c75b Mon Sep 17 00:00:00 2001 From: Bhargava Sai Macha Date: Fri, 12 Apr 2024 16:44:52 -0400 Subject: [PATCH 1/4] make token account copy --- spl/src/token.rs | 2 +- spl/src/token_interface.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spl/src/token.rs b/spl/src/token.rs index 5cd2f23b42..8a711cf36a 100644 --- a/spl/src/token.rs +++ b/spl/src/token.rs @@ -443,7 +443,7 @@ pub struct SyncNative<'info> { pub account: AccountInfo<'info>, } -#[derive(Clone, Debug, Default, PartialEq)] +#[derive(Clone, Debug, Default, PartialEq, Copy)] pub struct TokenAccount(spl_token::state::Account); impl TokenAccount { diff --git a/spl/src/token_interface.rs b/spl/src/token_interface.rs index ea6496e03c..8eb5ed5f84 100644 --- a/spl/src/token_interface.rs +++ b/spl/src/token_interface.rs @@ -13,7 +13,7 @@ pub use crate::token_2022_extensions::*; static IDS: [Pubkey; 2] = [spl_token::ID, spl_token_2022::ID]; -#[derive(Clone, Debug, Default, PartialEq)] +#[derive(Clone, Debug, Default, PartialEq, Copy)] pub struct TokenAccount(spl_token_2022::state::Account); impl anchor_lang::AccountDeserialize for TokenAccount { From 3c1dc4598c73a90f9be8621671294ab10f634e8b Mon Sep 17 00:00:00 2001 From: Bhargava Sai Macha Date: Sat, 13 Apr 2024 16:31:55 -0400 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a00943abc..8536fa0b25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ The minor version will be incremented upon a breaking change and the patch versi - idl: Store deployment addresses for other clusters ([#2892](https://github.com/coral-xyz/anchor/pull/2892)). - lang: Add `Event` utility type to get events from bytes ([#2897](https://github.com/coral-xyz/anchor/pull/2897)). - lang, spl: Add support for [token extensions](https://solana.com/solutions/token-extensions) ([#2789](https://github.com/coral-xyz/anchor/pull/2789)). +- spl: Make TokenAccount Copy ([#2904])(https://github.com/coral-xyz/anchor/pull/2904) ### Fixes From 82d4bc23078569cd4ecccf0eb5cc184930a7b01d Mon Sep 17 00:00:00 2001 From: Bhargava Sai Macha Date: Sat, 13 Apr 2024 16:32:43 -0400 Subject: [PATCH 3/4] move to fixes --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8536fa0b25..7486049f6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,6 @@ The minor version will be incremented upon a breaking change and the patch versi - idl: Store deployment addresses for other clusters ([#2892](https://github.com/coral-xyz/anchor/pull/2892)). - lang: Add `Event` utility type to get events from bytes ([#2897](https://github.com/coral-xyz/anchor/pull/2897)). - lang, spl: Add support for [token extensions](https://solana.com/solutions/token-extensions) ([#2789](https://github.com/coral-xyz/anchor/pull/2789)). -- spl: Make TokenAccount Copy ([#2904])(https://github.com/coral-xyz/anchor/pull/2904) ### Fixes @@ -72,6 +71,7 @@ The minor version will be incremented upon a breaking change and the patch versi - avm, cli: Fix `stdsimd` feature compilation error from `ahash` when installing the CLI using newer Rust versions ([#2867](https://github.com/coral-xyz/anchor/pull/2867)). - spl: Fix not being able to deserialize newer token 2022 extensions ([#2876](https://github.com/coral-xyz/anchor/pull/2876)). - spl: Remove `solana-program` dependency ([#2900](https://github.com/coral-xyz/anchor/pull/2900)). +- spl: Make TokenAccount Copy ([#2904])(https://github.com/coral-xyz/anchor/pull/2904) ### Breaking From a7ca890d56aef754053f3ac60adf40a0088527cd Mon Sep 17 00:00:00 2001 From: Bhargava Sai Macha Date: Sat, 13 Apr 2024 17:12:04 -0400 Subject: [PATCH 4/4] make Mint Copy --- CHANGELOG.md | 2 +- spl/src/token.rs | 2 +- spl/src/token_interface.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7486049f6a..d5c74ab012 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,7 +71,7 @@ The minor version will be incremented upon a breaking change and the patch versi - avm, cli: Fix `stdsimd` feature compilation error from `ahash` when installing the CLI using newer Rust versions ([#2867](https://github.com/coral-xyz/anchor/pull/2867)). - spl: Fix not being able to deserialize newer token 2022 extensions ([#2876](https://github.com/coral-xyz/anchor/pull/2876)). - spl: Remove `solana-program` dependency ([#2900](https://github.com/coral-xyz/anchor/pull/2900)). -- spl: Make TokenAccount Copy ([#2904])(https://github.com/coral-xyz/anchor/pull/2904) +- spl: Make TokenAccount and Mint Copy ([#2904])(https://github.com/coral-xyz/anchor/pull/2904) ### Breaking diff --git a/spl/src/token.rs b/spl/src/token.rs index 8a711cf36a..e91d975621 100644 --- a/spl/src/token.rs +++ b/spl/src/token.rs @@ -474,7 +474,7 @@ impl Deref for TokenAccount { } } -#[derive(Clone, Debug, Default, PartialEq)] +#[derive(Clone, Debug, Default, PartialEq, Copy)] pub struct Mint(spl_token::state::Mint); impl Mint { diff --git a/spl/src/token_interface.rs b/spl/src/token_interface.rs index 8eb5ed5f84..5b1b4db2c6 100644 --- a/spl/src/token_interface.rs +++ b/spl/src/token_interface.rs @@ -42,7 +42,7 @@ impl Deref for TokenAccount { } } -#[derive(Clone, Debug, Default, PartialEq)] +#[derive(Clone, Debug, Default, PartialEq, Copy)] pub struct Mint(spl_token_2022::state::Mint); impl anchor_lang::AccountDeserialize for Mint {