From 9c8de011e7a6831cc2fe4c5dae577c051069c84f Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 7 Aug 2020 23:58:18 -0700 Subject: [PATCH 01/92] Reorganize crates based on program --- program/README.md | 7 ++++++ program/src/Cargo.toml | 24 +++++++++++++++++++ program/src/entrypoint.rs | 50 +++++++++++++++++++++++++++++++++++++++ program/src/lib.rs | 11 +++++++++ 4 files changed, 92 insertions(+) create mode 100644 program/README.md create mode 100644 program/src/Cargo.toml create mode 100644 program/src/entrypoint.rs create mode 100644 program/src/lib.rs diff --git a/program/README.md b/program/README.md new file mode 100644 index 00000000..6a8a00f3 --- /dev/null +++ b/program/README.md @@ -0,0 +1,7 @@ +# Memo Program + +A simple program that validates a string of UTF-8 encoded characters. It can be +used to record a string on-chain, stored in the instruction data of a successful +transaction. + +Full documentation is available at https://spl.solana.com diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml new file mode 100644 index 00000000..cf5bb8cc --- /dev/null +++ b/program/src/Cargo.toml @@ -0,0 +1,24 @@ + +# Note: This crate must be built using do.sh + +[package] +name = "spl-memo" +version = "1.0.7" +description = "Solana Program Library Memo" +authors = ["Solana Maintainers "] +repository = "https://github.com/solana-labs/solana-program-library" +license = "Apache-2.0" +edition = "2018" + +[features] +no-entrypoint = [] +skip-no-mangle = ["solana-sdk/skip-no-mangle"] +program = ["solana-sdk/program"] +default = ["solana-sdk/default"] + +[dependencies] +solana-sdk = { version = "1.2.17", default-features = false, optional = true } + +[lib] +name = "spl_memo" +crate-type = ["cdylib", "lib"] diff --git a/program/src/entrypoint.rs b/program/src/entrypoint.rs new file mode 100644 index 00000000..56adbbb8 --- /dev/null +++ b/program/src/entrypoint.rs @@ -0,0 +1,50 @@ +//! Program entrypoint definitions + +#![cfg(feature = "program")] +#![cfg(not(feature = "no-entrypoint"))] + +use solana_sdk::{ + account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, program_error::ProgramError, + pubkey::Pubkey, +}; +use std::str::from_utf8; + +entrypoint!(process_instruction); +fn process_instruction<'a>( + _program_id: &Pubkey, + _accounts: &'a [AccountInfo<'a>], + instruction_data: &[u8], +) -> ProgramResult { + from_utf8(instruction_data).map_err(|_| ProgramError::InvalidInstructionData)?; + Ok(()) +} + +// Pull in syscall stubs when building for non-BPF targets +#[cfg(not(target_arch = "bpf"))] +solana_sdk::program_stubs!(); + +#[cfg(test)] +mod tests { + use super::*; + use solana_sdk::{program_error::ProgramError, pubkey::Pubkey}; + + #[test] + fn test_utf8_memo() { + let program_id = Pubkey::new(&[0; 32]); + + let string = b"letters and such"; + assert_eq!(Ok(()), process_instruction(&program_id, &[], string)); + + let emoji = "🐆".as_bytes(); + let bytes = [0xF0, 0x9F, 0x90, 0x86]; + assert_eq!(emoji, bytes); + assert_eq!(Ok(()), process_instruction(&program_id, &[], &emoji)); + + let mut bad_utf8 = bytes; + bad_utf8[3] = 0xFF; // Invalid UTF-8 byte + assert_eq!( + Err(ProgramError::InvalidInstructionData), + process_instruction(&program_id, &[], &bad_utf8) + ); + } +} diff --git a/program/src/lib.rs b/program/src/lib.rs new file mode 100644 index 00000000..56571644 --- /dev/null +++ b/program/src/lib.rs @@ -0,0 +1,11 @@ +#![deny(missing_docs)] + +//! A simple program that accepts a string of encoded characters and verifies that it parses. Currently handles UTF-8. + +pub mod entrypoint; + +// Export current solana-sdk types for downstream users who may also be building with a different +// solana-sdk version +pub use solana_sdk; + +solana_sdk::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo"); From 400c2a218ac951211387f1eae1a2a7ffe937ee0e Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sat, 8 Aug 2020 15:27:08 -0700 Subject: [PATCH 02/92] Move program READMEs back --- program/README.md | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 program/README.md diff --git a/program/README.md b/program/README.md deleted file mode 100644 index 6a8a00f3..00000000 --- a/program/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Memo Program - -A simple program that validates a string of UTF-8 encoded characters. It can be -used to record a string on-chain, stored in the instruction data of a successful -transaction. - -Full documentation is available at https://spl.solana.com From f15afe9dc20fc01b8745f51fbda272f9958f1773 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2020 00:47:01 +0000 Subject: [PATCH 03/92] Bump solana-sdk from 1.3.2 to 1.3.4 Bumps [solana-sdk](https://github.com/solana-labs/solana) from 1.3.2 to 1.3.4. - [Release notes](https://github.com/solana-labs/solana/releases) - [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md) - [Commits](https://github.com/solana-labs/solana/compare/v1.3.2...v1.3.4) Signed-off-by: dependabot[bot] --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index cf5bb8cc..539d8ff2 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -17,7 +17,7 @@ program = ["solana-sdk/program"] default = ["solana-sdk/default"] [dependencies] -solana-sdk = { version = "1.2.17", default-features = false, optional = true } +solana-sdk = { version = "1.3.4", default-features = false, optional = true } [lib] name = "spl_memo" From bccbb23b75f8bb8e18c560a5eeff68b212c16a8d Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sat, 29 Aug 2020 14:42:18 -0700 Subject: [PATCH 04/92] Update to Solana 1.3.6 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 539d8ff2..91e35efe 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -17,7 +17,7 @@ program = ["solana-sdk/program"] default = ["solana-sdk/default"] [dependencies] -solana-sdk = { version = "1.3.4", default-features = false, optional = true } +solana-sdk = { version = "1.3.6", default-features = false, optional = true } [lib] name = "spl_memo" From 068efa3dfbea596cbf4db830b11050da989961a9 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Thu, 3 Sep 2020 20:17:12 -0600 Subject: [PATCH 05/92] Bump solana crates to 1.3.8 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 91e35efe..62611dc4 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -17,7 +17,7 @@ program = ["solana-sdk/program"] default = ["solana-sdk/default"] [dependencies] -solana-sdk = { version = "1.3.6", default-features = false, optional = true } +solana-sdk = { version = "1.3.8", default-features = false, optional = true } [lib] name = "spl_memo" From ddbbfa0de46b460cb45592dfc9f8fdf01e236f70 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Thu, 10 Sep 2020 17:25:43 +0800 Subject: [PATCH 06/92] Bump dependencies from 1.3.8 to 1.3.9 (#415) --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 62611dc4..35dcfe9d 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -17,7 +17,7 @@ program = ["solana-sdk/program"] default = ["solana-sdk/default"] [dependencies] -solana-sdk = { version = "1.3.8", default-features = false, optional = true } +solana-sdk = { version = "1.3.9", default-features = false, optional = true } [lib] name = "spl_memo" From a8df77c3388b6a57e2216dd84121a5a1275f8d6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Sep 2020 09:22:53 +0000 Subject: [PATCH 07/92] Bump solana-sdk from 1.3.9 to 1.3.11 (#454) Bumps [solana-sdk](https://github.com/solana-labs/solana) from 1.3.9 to 1.3.11. - [Release notes](https://github.com/solana-labs/solana/releases) - [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md) - [Commits](https://github.com/solana-labs/solana/compare/v1.3.9...v1.3.11) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 35dcfe9d..b73c3bdd 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -17,7 +17,7 @@ program = ["solana-sdk/program"] default = ["solana-sdk/default"] [dependencies] -solana-sdk = { version = "1.3.9", default-features = false, optional = true } +solana-sdk = { version = "1.3.11", default-features = false, optional = true } [lib] name = "spl_memo" From 7dc81e9218b04ccc28063140967ea0933c3ab7cf Mon Sep 17 00:00:00 2001 From: Jack May Date: Mon, 21 Sep 2020 08:38:29 -0700 Subject: [PATCH 08/92] Bump solana-sdk to v1.3.12 (#484) --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index b73c3bdd..2fd99c4b 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -17,7 +17,7 @@ program = ["solana-sdk/program"] default = ["solana-sdk/default"] [dependencies] -solana-sdk = { version = "1.3.11", default-features = false, optional = true } +solana-sdk = { version = "1.3.12", default-features = false, optional = true } [lib] name = "spl_memo" From c3435281bd8b072bdc0e0749a7976873f3141a9a Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Fri, 2 Oct 2020 22:47:39 +0200 Subject: [PATCH 09/92] token-swap: Assess swap fee on input token (#562) * token-swap: Assess swap fee on input token * Update token-swap/program/src/curve.rs Co-authored-by: Tyera Eulberg * Update token-swap/program/src/curve.rs Co-authored-by: Tyera Eulberg * Fix new var name everywhere Co-authored-by: Tyera Eulberg --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 2fd99c4b..c677d3fa 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -17,7 +17,7 @@ program = ["solana-sdk/program"] default = ["solana-sdk/default"] [dependencies] -solana-sdk = { version = "1.3.12", default-features = false, optional = true } +solana-sdk = { version = "1.3.14", default-features = false, optional = true } [lib] name = "spl_memo" From 0e4ed41cb1b0953a9425d16aaa635e842f7e6057 Mon Sep 17 00:00:00 2001 From: Jack May Date: Mon, 5 Oct 2020 22:06:24 -0700 Subject: [PATCH 10/92] solana sdk does not need skip-no-mangle --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index c677d3fa..a72f52de 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,7 +12,7 @@ edition = "2018" [features] no-entrypoint = [] -skip-no-mangle = ["solana-sdk/skip-no-mangle"] +skip-no-mangle = [] program = ["solana-sdk/program"] default = ["solana-sdk/default"] From 0cf64b58caa9136510793bbe169d52290696981b Mon Sep 17 00:00:00 2001 From: Jack May Date: Tue, 6 Oct 2020 13:45:20 -0700 Subject: [PATCH 11/92] Remove skip-no-mangle entirely --- program/src/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index a72f52de..663ec20b 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,7 +12,6 @@ edition = "2018" [features] no-entrypoint = [] -skip-no-mangle = [] program = ["solana-sdk/program"] default = ["solana-sdk/default"] From 2f3cfa1f58ae800565f32e75e18fc8c0f556de5d Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Thu, 15 Oct 2020 12:20:23 -0600 Subject: [PATCH 12/92] Bump memo and token versions (#627) --- program/src/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 663ec20b..8578d6de 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "spl-memo" -version = "1.0.7" +version = "1.0.9" description = "Solana Program Library Memo" authors = ["Solana Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" @@ -16,7 +16,7 @@ program = ["solana-sdk/program"] default = ["solana-sdk/default"] [dependencies] -solana-sdk = { version = "1.3.14", default-features = false, optional = true } +solana-sdk = { version = "1.3.17", default-features = false, optional = true } [lib] name = "spl_memo" From 6f494e95b7db47a3c1d4c5f6a03fa41a13473259 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 22 Oct 2020 21:44:27 -0700 Subject: [PATCH 13/92] Port SPL to solana-program and `cargo build-bpf` --- program/src/Cargo.toml | 9 ++------- program/src/entrypoint.rs | 18 ++++++------------ program/src/lib.rs | 10 +++++----- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 8578d6de..813bc57f 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -1,6 +1,3 @@ - -# Note: This crate must be built using do.sh - [package] name = "spl-memo" version = "1.0.9" @@ -11,12 +8,10 @@ license = "Apache-2.0" edition = "2018" [features] -no-entrypoint = [] -program = ["solana-sdk/program"] -default = ["solana-sdk/default"] +exclude_entrypoint = [] [dependencies] -solana-sdk = { version = "1.3.17", default-features = false, optional = true } +solana-program = "1.4.3" [lib] name = "spl_memo" diff --git a/program/src/entrypoint.rs b/program/src/entrypoint.rs index 56adbbb8..fba0c2a8 100644 --- a/program/src/entrypoint.rs +++ b/program/src/entrypoint.rs @@ -1,11 +1,8 @@ -//! Program entrypoint definitions +//! Program entrypoint -#![cfg(feature = "program")] -#![cfg(not(feature = "no-entrypoint"))] - -use solana_sdk::{ - account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, program_error::ProgramError, - pubkey::Pubkey, +use solana_program::{ + account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, info, + program_error::ProgramError, pubkey::Pubkey, }; use std::str::from_utf8; @@ -15,18 +12,15 @@ fn process_instruction<'a>( _accounts: &'a [AccountInfo<'a>], instruction_data: &[u8], ) -> ProgramResult { + info!("hi"); from_utf8(instruction_data).map_err(|_| ProgramError::InvalidInstructionData)?; Ok(()) } -// Pull in syscall stubs when building for non-BPF targets -#[cfg(not(target_arch = "bpf"))] -solana_sdk::program_stubs!(); - #[cfg(test)] mod tests { use super::*; - use solana_sdk::{program_error::ProgramError, pubkey::Pubkey}; + use solana_program::{program_error::ProgramError, pubkey::Pubkey}; #[test] fn test_utf8_memo() { diff --git a/program/src/lib.rs b/program/src/lib.rs index 56571644..85e0cabe 100644 --- a/program/src/lib.rs +++ b/program/src/lib.rs @@ -2,10 +2,10 @@ //! A simple program that accepts a string of encoded characters and verifies that it parses. Currently handles UTF-8. -pub mod entrypoint; +#[cfg(not(feature = "exclude_entrypoint"))] +mod entrypoint; -// Export current solana-sdk types for downstream users who may also be building with a different -// solana-sdk version -pub use solana_sdk; +// Export current sdk types for downstream users building with a different sdk version +pub use solana_program; -solana_sdk::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo"); +solana_program::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo"); From 4f0bd30cb19858b44753e9e6e96808cc368d8b21 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sat, 24 Oct 2020 20:01:49 -0700 Subject: [PATCH 14/92] Groom Cargo.tomls --- program/src/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 813bc57f..167a0892 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -14,5 +14,4 @@ exclude_entrypoint = [] solana-program = "1.4.3" [lib] -name = "spl_memo" crate-type = ["cdylib", "lib"] From 0b43fee0da5d7fe1aca5a4f75435ba54644accfc Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sat, 31 Oct 2020 21:45:09 -0700 Subject: [PATCH 15/92] Update to solana v1.4.4 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 167a0892..6e6079a0 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" exclude_entrypoint = [] [dependencies] -solana-program = "1.4.3" +solana-program = "1.4.4" [lib] crate-type = ["cdylib", "lib"] From 72b82122d61481ab2ae007314acdade5fa71a126 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sun, 1 Nov 2020 00:22:04 -0700 Subject: [PATCH 16/92] Drop lifetimes --- program/src/entrypoint.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/program/src/entrypoint.rs b/program/src/entrypoint.rs index fba0c2a8..0852451b 100644 --- a/program/src/entrypoint.rs +++ b/program/src/entrypoint.rs @@ -1,18 +1,17 @@ //! Program entrypoint use solana_program::{ - account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, info, - program_error::ProgramError, pubkey::Pubkey, + account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, program_error::ProgramError, + pubkey::Pubkey, }; use std::str::from_utf8; entrypoint!(process_instruction); -fn process_instruction<'a>( +fn process_instruction( _program_id: &Pubkey, - _accounts: &'a [AccountInfo<'a>], + _accounts: &[AccountInfo], instruction_data: &[u8], ) -> ProgramResult { - info!("hi"); from_utf8(instruction_data).map_err(|_| ProgramError::InvalidInstructionData)?; Ok(()) } From 3eabeeca06164607d985114dc4cb8d6f82cb9b0d Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 3 Nov 2020 09:33:32 -0800 Subject: [PATCH 17/92] Back to no-entrypoint feature name --- program/src/Cargo.toml | 2 +- program/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 6e6079a0..d000d02d 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -8,7 +8,7 @@ license = "Apache-2.0" edition = "2018" [features] -exclude_entrypoint = [] +no-entrypoint = [] [dependencies] solana-program = "1.4.4" diff --git a/program/src/lib.rs b/program/src/lib.rs index 85e0cabe..ba495f0e 100644 --- a/program/src/lib.rs +++ b/program/src/lib.rs @@ -2,7 +2,7 @@ //! A simple program that accepts a string of encoded characters and verifies that it parses. Currently handles UTF-8. -#[cfg(not(feature = "exclude_entrypoint"))] +#[cfg(not(feature = "no-entrypoint"))] mod entrypoint; // Export current sdk types for downstream users building with a different sdk version From d7698341a3f570c728b017f477304461a6363dd8 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 4 Nov 2020 11:13:23 -0800 Subject: [PATCH 18/92] Bump spl-memo to v2.0.0 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index d000d02d..4dc70bf6 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spl-memo" -version = "1.0.9" +version = "2.0.0" description = "Solana Program Library Memo" authors = ["Solana Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" From 613dc56d3d0419be590707d79f79b19dbde44fdf Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 4 Nov 2020 11:34:17 -0800 Subject: [PATCH 19/92] Limit docs.rs builds --- program/src/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 4dc70bf6..769f35fb 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -15,3 +15,6 @@ solana-program = "1.4.4" [lib] crate-type = ["cdylib", "lib"] + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] From 248043e9f9fd15a6c514c2d19f88e552c56f4b08 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 6 Nov 2020 09:18:20 -0800 Subject: [PATCH 20/92] Bump solana version to v1.4.5 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 769f35fb..58508e23 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.4.4" +solana-program = "1.4.5" [lib] crate-type = ["cdylib", "lib"] From 1ab05d22bec13c3f85689d14faf680579936a049 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2020 12:39:52 +0000 Subject: [PATCH 21/92] Bump solana-program from 1.4.5 to 1.4.6 (#826) Bumps [solana-program](https://github.com/solana-labs/solana) from 1.4.5 to 1.4.6. - [Release notes](https://github.com/solana-labs/solana/releases) - [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md) - [Commits](https://github.com/solana-labs/solana/compare/v1.4.5...v1.4.6) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 58508e23..e8624d26 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.4.5" +solana-program = "1.4.6" [lib] crate-type = ["cdylib", "lib"] From 266dd1f63553611d6f9af2e533fb9cba6ba40202 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 12 Nov 2020 09:19:39 -0800 Subject: [PATCH 22/92] Upgrade to Solana 1.4.7 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index e8624d26..1bd56617 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.4.6" +solana-program = "1.4.7" [lib] crate-type = ["cdylib", "lib"] From 58668085b5d1bb3a327ada4b0d89e58f0a5c9544 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 13 Nov 2020 17:57:21 -0800 Subject: [PATCH 23/92] Update to Solana 1.4.8 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 1bd56617..0ded7b41 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.4.7" +solana-program = "1.4.8" [lib] crate-type = ["cdylib", "lib"] From 9400b4744936792e2818b154e1fd1a319441ad6d Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 17 Nov 2020 17:26:59 -0800 Subject: [PATCH 24/92] Bump solana version to v1.4.9 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 0ded7b41..57936197 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.4.8" +solana-program = "1.4.9" [lib] crate-type = ["cdylib", "lib"] From ff19a3d002cf6ab4cba5f0d41727436d439911be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 12:54:42 +0000 Subject: [PATCH 25/92] Bump solana-program from 1.4.9 to 1.4.13 (#916) Bumps [solana-program](https://github.com/solana-labs/solana) from 1.4.9 to 1.4.13. - [Release notes](https://github.com/solana-labs/solana/releases) - [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md) - [Commits](https://github.com/solana-labs/solana/compare/v1.4.9...v1.4.13) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 57936197..184638d7 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.4.9" +solana-program = "1.4.13" [lib] crate-type = ["cdylib", "lib"] From e81beb5500b50a4f1c0f47a6bbd6cf7ccb888cb4 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 2 Dec 2020 18:37:53 -0800 Subject: [PATCH 26/92] Upgrade to Solana v1.4.14 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 184638d7..43e0f43a 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.4.13" +solana-program = "1.4.14" [lib] crate-type = ["cdylib", "lib"] From 7bbd81badaa7e8fde5534bf2cdceb09b04835361 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Wed, 16 Dec 2020 11:51:03 -0700 Subject: [PATCH 27/92] Bump {ata,memo,token-{program,cli}} to solana v1.4.17 To pick up cargo audit fixes for monorepo --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 43e0f43a..2a6bf481 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.4.14" +solana-program = "1.4.17" [lib] crate-type = ["cdylib", "lib"] From c21c50c9badce9242ab6a345f64de3bf2fc834dc Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Wed, 16 Dec 2020 11:53:15 -0700 Subject: [PATCH 28/92] Bump memo to v2.0.1 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 2a6bf481..dc4eb6de 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spl-memo" -version = "2.0.0" +version = "2.0.1" description = "Solana Program Library Memo" authors = ["Solana Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" From 1d15c6a6faad5f9b80ad3fee2c43516bd9de733b Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 17 Dec 2020 16:11:56 -0800 Subject: [PATCH 29/92] Update to Solana 1.5.0 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index dc4eb6de..31994ed7 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.4.17" +solana-program = "1.5.0" [lib] crate-type = ["cdylib", "lib"] From 9cba96c721903597b5644ac473bdaa16dbfd8d12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 13:51:29 +0000 Subject: [PATCH 30/92] build(deps): bump solana-program from 1.5.0 to 1.5.1 (#1025) Bumps [solana-program](https://github.com/solana-labs/solana) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/solana-labs/solana/releases) - [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md) - [Commits](https://github.com/solana-labs/solana/compare/v1.5.0...v1.5.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 31994ed7..9cfcd28c 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.5.0" +solana-program = "1.5.1" [lib] crate-type = ["cdylib", "lib"] From 49961263be45fe605de6d186cbf218e42607e465 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Thu, 28 Jan 2021 12:21:21 -0700 Subject: [PATCH 31/92] Add initial signed-memo program (#1135) * Initial s-memo * Populate readme * Add signed-memo to spl docs * Log less, fail faster * Replace and bump memo * Update memo id * Add memo prefix and len * Add test that demonstrates compute bounds * Add logging and compute to memo docs --- program/src/Cargo.toml | 8 +- program/src/entrypoint.rs | 39 ++----- program/src/lib.rs | 29 ++++- program/src/processor.rs | 109 +++++++++++++++++++ program/tests/functional.rs | 207 ++++++++++++++++++++++++++++++++++++ 5 files changed, 355 insertions(+), 37 deletions(-) create mode 100644 program/src/processor.rs create mode 100644 program/tests/functional.rs diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 9cfcd28c..8657cc40 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spl-memo" -version = "2.0.1" +version = "3.0.0" description = "Solana Program Library Memo" authors = ["Solana Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" @@ -9,10 +9,16 @@ edition = "2018" [features] no-entrypoint = [] +test-bpf = [] [dependencies] solana-program = "1.5.1" +[dev-dependencies] +solana-program-test = "1.5.1" +solana-sdk = "1.5.1" +tokio = { version = "0.3", features = ["macros"]} + [lib] crate-type = ["cdylib", "lib"] diff --git a/program/src/entrypoint.rs b/program/src/entrypoint.rs index 0852451b..82641a41 100644 --- a/program/src/entrypoint.rs +++ b/program/src/entrypoint.rs @@ -1,43 +1,16 @@ //! Program entrypoint +#![cfg(not(feature = "no-entrypoint"))] + use solana_program::{ - account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, program_error::ProgramError, - pubkey::Pubkey, + account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, pubkey::Pubkey, }; -use std::str::from_utf8; entrypoint!(process_instruction); fn process_instruction( - _program_id: &Pubkey, - _accounts: &[AccountInfo], + program_id: &Pubkey, + accounts: &[AccountInfo], instruction_data: &[u8], ) -> ProgramResult { - from_utf8(instruction_data).map_err(|_| ProgramError::InvalidInstructionData)?; - Ok(()) -} - -#[cfg(test)] -mod tests { - use super::*; - use solana_program::{program_error::ProgramError, pubkey::Pubkey}; - - #[test] - fn test_utf8_memo() { - let program_id = Pubkey::new(&[0; 32]); - - let string = b"letters and such"; - assert_eq!(Ok(()), process_instruction(&program_id, &[], string)); - - let emoji = "🐆".as_bytes(); - let bytes = [0xF0, 0x9F, 0x90, 0x86]; - assert_eq!(emoji, bytes); - assert_eq!(Ok(()), process_instruction(&program_id, &[], &emoji)); - - let mut bad_utf8 = bytes; - bad_utf8[3] = 0xFF; // Invalid UTF-8 byte - assert_eq!( - Err(ProgramError::InvalidInstructionData), - process_instruction(&program_id, &[], &bad_utf8) - ); - } + crate::processor::process_instruction(program_id, accounts, instruction_data) } diff --git a/program/src/lib.rs b/program/src/lib.rs index ba495f0e..4f3b5d29 100644 --- a/program/src/lib.rs +++ b/program/src/lib.rs @@ -1,11 +1,34 @@ #![deny(missing_docs)] -//! A simple program that accepts a string of encoded characters and verifies that it parses. Currently handles UTF-8. +//! A program that accepts a string of encoded characters and verifies that it parses, +//! while verifying and logging signers. Currently handles UTF-8 characters. -#[cfg(not(feature = "no-entrypoint"))] mod entrypoint; +pub mod processor; // Export current sdk types for downstream users building with a different sdk version pub use solana_program; +use solana_program::{ + instruction::{AccountMeta, Instruction}, + pubkey::Pubkey, +}; -solana_program::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo"); +solana_program::declare_id!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"); + +/// Build a memo instruction, possibly signed +/// +/// Accounts expected by this instruction: +/// +/// 0. ..0+N. `[signer]` Expected signers; if zero provided, instruction will be processed as a +/// normal, unsigned spl-memo +/// +pub fn build_memo(memo: &[u8], signer_pubkeys: &[&Pubkey]) -> Instruction { + Instruction { + program_id: id(), + accounts: signer_pubkeys + .iter() + .map(|&pubkey| AccountMeta::new_readonly(*pubkey, true)) + .collect(), + data: memo.to_vec(), + } +} diff --git a/program/src/processor.rs b/program/src/processor.rs new file mode 100644 index 00000000..f1cb19d9 --- /dev/null +++ b/program/src/processor.rs @@ -0,0 +1,109 @@ +//! Program state processor + +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, msg, program_error::ProgramError, + pubkey::Pubkey, +}; +use std::str::from_utf8; + +/// Instruction processor +pub fn process_instruction( + _program_id: &Pubkey, + accounts: &[AccountInfo], + input: &[u8], +) -> ProgramResult { + let account_info_iter = &mut accounts.iter(); + let mut missing_required_signature = false; + for account_info in account_info_iter { + if let Some(address) = account_info.signer_key() { + msg!("Signed by {:?}", address); + } else { + missing_required_signature = true; + } + } + if missing_required_signature { + return Err(ProgramError::MissingRequiredSignature); + } + + let memo = from_utf8(input).map_err(|err| { + msg!("Invalid UTF-8, from byte {}", err.valid_up_to()); + ProgramError::InvalidInstructionData + })?; + msg!("Memo (len {}): {:?}", memo.len(), memo); + + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + use solana_program::{ + account_info::IntoAccountInfo, program_error::ProgramError, pubkey::Pubkey, + }; + use solana_sdk::account::Account; + + #[test] + fn test_utf8_memo() { + let program_id = Pubkey::new(&[0; 32]); + + let string = b"letters and such"; + assert_eq!(Ok(()), process_instruction(&program_id, &[], string)); + + let emoji = "🐆".as_bytes(); + let bytes = [0xF0, 0x9F, 0x90, 0x86]; + assert_eq!(emoji, bytes); + assert_eq!(Ok(()), process_instruction(&program_id, &[], &emoji)); + + let mut bad_utf8 = bytes; + bad_utf8[3] = 0xFF; // Invalid UTF-8 byte + assert_eq!( + Err(ProgramError::InvalidInstructionData), + process_instruction(&program_id, &[], &bad_utf8) + ); + } + + #[test] + fn test_signers() { + let program_id = Pubkey::new(&[0; 32]); + let memo = "🐆".as_bytes(); + + let pubkey0 = Pubkey::new_unique(); + let pubkey1 = Pubkey::new_unique(); + let pubkey2 = Pubkey::new_unique(); + let mut account0 = Account::default(); + let mut account1 = Account::default(); + let mut account2 = Account::default(); + + let signed_account_infos = vec![ + (&pubkey0, true, &mut account0).into_account_info(), + (&pubkey1, true, &mut account1).into_account_info(), + (&pubkey2, true, &mut account2).into_account_info(), + ]; + assert_eq!( + Ok(()), + process_instruction(&program_id, &signed_account_infos, memo) + ); + + assert_eq!(Ok(()), process_instruction(&program_id, &[], memo)); + + let unsigned_account_infos = vec![ + (&pubkey0, false, &mut account0).into_account_info(), + (&pubkey1, false, &mut account1).into_account_info(), + (&pubkey2, false, &mut account2).into_account_info(), + ]; + assert_eq!( + Err(ProgramError::MissingRequiredSignature), + process_instruction(&program_id, &unsigned_account_infos, memo) + ); + + let partially_signed_account_infos = vec![ + (&pubkey0, true, &mut account0).into_account_info(), + (&pubkey1, false, &mut account1).into_account_info(), + (&pubkey2, true, &mut account2).into_account_info(), + ]; + assert_eq!( + Err(ProgramError::MissingRequiredSignature), + process_instruction(&program_id, &partially_signed_account_infos, memo) + ); + } +} diff --git a/program/tests/functional.rs b/program/tests/functional.rs new file mode 100644 index 00000000..41f917d5 --- /dev/null +++ b/program/tests/functional.rs @@ -0,0 +1,207 @@ +#![cfg(feature = "test-bpf")] + +use solana_program::{ + instruction::{AccountMeta, Instruction, InstructionError}, + pubkey::Pubkey, +}; +use solana_program_test::*; +use solana_sdk::{ + signature::{Keypair, Signer}, + transaction::{Transaction, TransactionError}, +}; +use spl_memo::*; + +fn program_test() -> ProgramTest { + ProgramTest::new("spl_memo", id(), processor!(processor::process_instruction)) +} + +#[tokio::test] +async fn test_memo_signing() { + let memo = "🐆".as_bytes(); + let (mut banks_client, payer, recent_blockhash) = program_test().start().await; + + let keypairs = vec![Keypair::new(), Keypair::new(), Keypair::new()]; + let pubkeys: Vec = keypairs.iter().map(|keypair| keypair.pubkey()).collect(); + + // Test complete signing + let signer_key_refs: Vec<&Pubkey> = pubkeys.iter().collect(); + let mut transaction = + Transaction::new_with_payer(&[build_memo(memo, &signer_key_refs)], Some(&payer.pubkey())); + let mut signers = vec![&payer]; + for keypair in keypairs.iter() { + signers.push(keypair); + } + transaction.sign(&signers, recent_blockhash); + banks_client.process_transaction(transaction).await.unwrap(); + + // Test unsigned memo + let mut transaction = + Transaction::new_with_payer(&[build_memo(memo, &[])], Some(&payer.pubkey())); + transaction.sign(&[&payer], recent_blockhash); + banks_client.process_transaction(transaction).await.unwrap(); + + // Demonstrate success on signature provided, regardless of specific memo AccountMeta + let mut transaction = Transaction::new_with_payer( + &[Instruction { + program_id: id(), + accounts: vec![ + AccountMeta::new_readonly(keypairs[0].pubkey(), true), + AccountMeta::new_readonly(keypairs[1].pubkey(), true), + AccountMeta::new_readonly(payer.pubkey(), false), + ], + data: memo.to_vec(), + }], + Some(&payer.pubkey()), + ); + transaction.sign(&[&payer, &keypairs[0], &keypairs[1]], recent_blockhash); + banks_client.process_transaction(transaction).await.unwrap(); + + // Test missing signer(s) + let mut transaction = Transaction::new_with_payer( + &[Instruction { + program_id: id(), + accounts: vec![ + AccountMeta::new_readonly(keypairs[0].pubkey(), true), + AccountMeta::new_readonly(keypairs[1].pubkey(), false), + AccountMeta::new_readonly(keypairs[2].pubkey(), true), + ], + data: memo.to_vec(), + }], + Some(&payer.pubkey()), + ); + transaction.sign(&[&payer, &keypairs[0], &keypairs[2]], recent_blockhash); + assert_eq!( + banks_client + .process_transaction(transaction) + .await + .unwrap_err() + .unwrap(), + TransactionError::InstructionError(0, InstructionError::MissingRequiredSignature) + ); + + let mut transaction = Transaction::new_with_payer( + &[Instruction { + program_id: id(), + accounts: vec![ + AccountMeta::new_readonly(keypairs[0].pubkey(), false), + AccountMeta::new_readonly(keypairs[1].pubkey(), false), + AccountMeta::new_readonly(keypairs[2].pubkey(), false), + ], + data: memo.to_vec(), + }], + Some(&payer.pubkey()), + ); + transaction.sign(&[&payer], recent_blockhash); + assert_eq!( + banks_client + .process_transaction(transaction) + .await + .unwrap_err() + .unwrap(), + TransactionError::InstructionError(0, InstructionError::MissingRequiredSignature) + ); + + // Test invalid utf-8; demonstrate log + let invalid_utf8 = [0xF0, 0x9F, 0x90, 0x86, 0xF0, 0x9F, 0xFF, 0x86]; + let mut transaction = + Transaction::new_with_payer(&[build_memo(&invalid_utf8, &[])], Some(&payer.pubkey())); + transaction.sign(&[&payer], recent_blockhash); + assert_eq!( + banks_client + .process_transaction(transaction) + .await + .unwrap_err() + .unwrap(), + TransactionError::InstructionError(0, InstructionError::InvalidInstructionData) + ); +} + +#[tokio::test] +async fn test_memo_compute_limits() { + let (mut banks_client, payer, recent_blockhash) = program_test().start().await; + + // Test memo length + let mut memo = vec![]; + for _ in 0..1000 { + let mut vec = vec![0x53, 0x4F, 0x4C]; + memo.append(&mut vec); + } + + let mut transaction = + Transaction::new_with_payer(&[build_memo(&memo[..566], &[])], Some(&payer.pubkey())); + transaction.sign(&[&payer], recent_blockhash); + banks_client.process_transaction(transaction).await.unwrap(); + + let mut transaction = + Transaction::new_with_payer(&[build_memo(&memo[..567], &[])], Some(&payer.pubkey())); + transaction.sign(&[&payer], recent_blockhash); + assert_eq!( + banks_client + .process_transaction(transaction) + .await + .unwrap_err() + .unwrap(), + TransactionError::InstructionError(0, InstructionError::ProgramFailedToComplete) + ); + + let mut memo = vec![]; + for _ in 0..100 { + let mut vec = vec![0xE2, 0x97, 0x8E]; + memo.append(&mut vec); + } + + let mut transaction = + Transaction::new_with_payer(&[build_memo(&memo[..60], &[])], Some(&payer.pubkey())); + transaction.sign(&[&payer], recent_blockhash); + banks_client.process_transaction(transaction).await.unwrap(); + + let mut transaction = + Transaction::new_with_payer(&[build_memo(&memo[..63], &[])], Some(&payer.pubkey())); + transaction.sign(&[&payer], recent_blockhash); + assert_eq!( + banks_client + .process_transaction(transaction) + .await + .unwrap_err() + .unwrap(), + TransactionError::InstructionError(0, InstructionError::ProgramFailedToComplete) + ); + + // Test num signers with 32-byte memo + let memo = Pubkey::new_unique().to_bytes(); + let mut keypairs = vec![]; + for _ in 0..20 { + keypairs.push(Keypair::new()); + } + let pubkeys: Vec = keypairs.iter().map(|keypair| keypair.pubkey()).collect(); + let signer_key_refs: Vec<&Pubkey> = pubkeys.iter().collect(); + + let mut signers = vec![&payer]; + for keypair in keypairs[..12].iter() { + signers.push(keypair); + } + let mut transaction = Transaction::new_with_payer( + &[build_memo(&memo, &signer_key_refs[..12])], + Some(&payer.pubkey()), + ); + transaction.sign(&signers, recent_blockhash); + banks_client.process_transaction(transaction).await.unwrap(); + + let mut signers = vec![&payer]; + for keypair in keypairs[..13].iter() { + signers.push(keypair); + } + let mut transaction = Transaction::new_with_payer( + &[build_memo(&memo, &signer_key_refs[..13])], + Some(&payer.pubkey()), + ); + transaction.sign(&signers, recent_blockhash); + assert_eq!( + banks_client + .process_transaction(transaction) + .await + .unwrap_err() + .unwrap(), + TransactionError::InstructionError(0, InstructionError::ProgramFailedToComplete) + ); +} From ca25f3130ecab76c9ee0fb93dbf7d6fd0b4ecc24 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Thu, 11 Feb 2021 14:18:38 -0700 Subject: [PATCH 32/92] chore: bump solana crates to 1.5.6 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 8657cc40..d2baf179 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.5.1" +solana-program = "1.5.6" [dev-dependencies] -solana-program-test = "1.5.1" -solana-sdk = "1.5.1" +solana-program-test = "1.5.6" +solana-sdk = "1.5.6" tokio = { version = "0.3", features = ["macros"]} [lib] From 503dbc06db55855b8852c194fb53cb682f5ac37f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Feb 2021 23:56:18 +0000 Subject: [PATCH 33/92] build(deps): bump solana-program from 1.5.6 to 1.5.8 (#1261) Bumps [solana-program](https://github.com/solana-labs/solana) from 1.5.6 to 1.5.8. - [Release notes](https://github.com/solana-labs/solana/releases) - [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md) - [Commits](https://github.com/solana-labs/solana/compare/v1.5.6...v1.5.8) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index d2baf179..4e821eb8 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,7 +12,7 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.5.6" +solana-program = "1.5.8" [dev-dependencies] solana-program-test = "1.5.6" From ba39f9563de5286fb5e011b38046ac87bafd9f44 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Tue, 2 Mar 2021 19:19:50 +0100 Subject: [PATCH 34/92] Update solana-program to 1.5.11 (#1362) * Update solana-program to 1.5.11 * Update all programs --- program/src/Cargo.toml | 6 +++--- program/tests/functional.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 4e821eb8..d8ad104d 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.5.8" +solana-program = "1.5.11" [dev-dependencies] -solana-program-test = "1.5.6" -solana-sdk = "1.5.6" +solana-program-test = "1.5.11" +solana-sdk = "1.5.11" tokio = { version = "0.3", features = ["macros"]} [lib] diff --git a/program/tests/functional.rs b/program/tests/functional.rs index 41f917d5..511591b8 100644 --- a/program/tests/functional.rs +++ b/program/tests/functional.rs @@ -128,12 +128,12 @@ async fn test_memo_compute_limits() { } let mut transaction = - Transaction::new_with_payer(&[build_memo(&memo[..566], &[])], Some(&payer.pubkey())); + Transaction::new_with_payer(&[build_memo(&memo[..565], &[])], Some(&payer.pubkey())); transaction.sign(&[&payer], recent_blockhash); banks_client.process_transaction(transaction).await.unwrap(); let mut transaction = - Transaction::new_with_payer(&[build_memo(&memo[..567], &[])], Some(&payer.pubkey())); + Transaction::new_with_payer(&[build_memo(&memo[..568], &[])], Some(&payer.pubkey())); transaction.sign(&[&payer], recent_blockhash); assert_eq!( banks_client From e812b065a008f7cfdcfa1460fe4a5900baadbd0d Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Thu, 4 Mar 2021 22:02:32 +0100 Subject: [PATCH 35/92] memo: Expand error type to make test less flaky (#1380) * memo: Expand error type to make test less flaky * Cleanup errors as vars because cargo fmt looks ridiculous --- program/tests/functional.rs | 46 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/program/tests/functional.rs b/program/tests/functional.rs index 511591b8..01516e63 100644 --- a/program/tests/functional.rs +++ b/program/tests/functional.rs @@ -135,14 +135,16 @@ async fn test_memo_compute_limits() { let mut transaction = Transaction::new_with_payer(&[build_memo(&memo[..568], &[])], Some(&payer.pubkey())); transaction.sign(&[&payer], recent_blockhash); - assert_eq!( - banks_client - .process_transaction(transaction) - .await - .unwrap_err() - .unwrap(), - TransactionError::InstructionError(0, InstructionError::ProgramFailedToComplete) - ); + let err = banks_client + .process_transaction(transaction) + .await + .unwrap_err() + .unwrap(); + let failed_to_complete = + TransactionError::InstructionError(0, InstructionError::ProgramFailedToComplete); + let computational_budget_exceeded = + TransactionError::InstructionError(0, InstructionError::ComputationalBudgetExceeded); + assert!(err == failed_to_complete || err == computational_budget_exceeded); let mut memo = vec![]; for _ in 0..100 { @@ -158,14 +160,12 @@ async fn test_memo_compute_limits() { let mut transaction = Transaction::new_with_payer(&[build_memo(&memo[..63], &[])], Some(&payer.pubkey())); transaction.sign(&[&payer], recent_blockhash); - assert_eq!( - banks_client - .process_transaction(transaction) - .await - .unwrap_err() - .unwrap(), - TransactionError::InstructionError(0, InstructionError::ProgramFailedToComplete) - ); + let err = banks_client + .process_transaction(transaction) + .await + .unwrap_err() + .unwrap(); + assert!(err == failed_to_complete || err == computational_budget_exceeded); // Test num signers with 32-byte memo let memo = Pubkey::new_unique().to_bytes(); @@ -196,12 +196,10 @@ async fn test_memo_compute_limits() { Some(&payer.pubkey()), ); transaction.sign(&signers, recent_blockhash); - assert_eq!( - banks_client - .process_transaction(transaction) - .await - .unwrap_err() - .unwrap(), - TransactionError::InstructionError(0, InstructionError::ProgramFailedToComplete) - ); + let err = banks_client + .process_transaction(transaction) + .await + .unwrap_err() + .unwrap(); + assert!(err == failed_to_complete || err == computational_budget_exceeded); } From e9692f2bf92d75b4ef5326cae34c3e73a9d34051 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 15 Mar 2021 22:38:47 -0700 Subject: [PATCH 36/92] Remove tokio dev-dependency --- program/src/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index d8ad104d..e7e1ff85 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -17,7 +17,6 @@ solana-program = "1.5.11" [dev-dependencies] solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] From 66dabbdef4ea59c0fbd562f0a189b191f45718af Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 16 Mar 2021 13:47:59 -0700 Subject: [PATCH 37/92] Bump Solana version to 1.5.15 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index e7e1ff85..3493dd74 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.5.11" +solana-program = "1.5.15" [dev-dependencies] -solana-program-test = "1.5.11" -solana-sdk = "1.5.11" +solana-program-test = "1.5.15" +solana-sdk = "1.5.15" [lib] crate-type = ["cdylib", "lib"] From 50ebce7cdadc87438a5cc71131e61d0f6e36222f Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 16 Mar 2021 23:51:40 -0700 Subject: [PATCH 38/92] Adjust test_memo_compute_limits to account for toolchain differences --- program/tests/functional.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/program/tests/functional.rs b/program/tests/functional.rs index 01516e63..5158d02e 100644 --- a/program/tests/functional.rs +++ b/program/tests/functional.rs @@ -128,12 +128,12 @@ async fn test_memo_compute_limits() { } let mut transaction = - Transaction::new_with_payer(&[build_memo(&memo[..565], &[])], Some(&payer.pubkey())); + Transaction::new_with_payer(&[build_memo(&memo[..450], &[])], Some(&payer.pubkey())); transaction.sign(&[&payer], recent_blockhash); banks_client.process_transaction(transaction).await.unwrap(); let mut transaction = - Transaction::new_with_payer(&[build_memo(&memo[..568], &[])], Some(&payer.pubkey())); + Transaction::new_with_payer(&[build_memo(&memo[..600], &[])], Some(&payer.pubkey())); transaction.sign(&[&payer], recent_blockhash); let err = banks_client .process_transaction(transaction) @@ -188,11 +188,11 @@ async fn test_memo_compute_limits() { banks_client.process_transaction(transaction).await.unwrap(); let mut signers = vec![&payer]; - for keypair in keypairs[..13].iter() { + for keypair in keypairs[..15].iter() { signers.push(keypair); } let mut transaction = Transaction::new_with_payer( - &[build_memo(&memo, &signer_key_refs[..13])], + &[build_memo(&memo, &signer_key_refs[..15])], Some(&payer.pubkey()), ); transaction.sign(&signers, recent_blockhash); From df93fe3a4a3ebc85596c90a54dfba29be3cfb36b Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 17 Mar 2021 20:21:21 -0700 Subject: [PATCH 39/92] Bump Solana version to 1.6.1 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 3493dd74..773b7902 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.5.15" +solana-program = "1.6.1" [dev-dependencies] -solana-program-test = "1.5.15" -solana-sdk = "1.5.15" +solana-program-test = "1.6.1" +solana-sdk = "1.6.1" [lib] crate-type = ["cdylib", "lib"] From 5a393c9a9a4ff4fa6cc0afbe3a7932b7bdddb6df Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 30 Mar 2021 08:41:53 -0700 Subject: [PATCH 40/92] Update to Solana 1.6.2 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 773b7902..5a75bd1c 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.6.1" +solana-program = "1.6.2" [dev-dependencies] -solana-program-test = "1.6.1" -solana-sdk = "1.6.1" +solana-program-test = "1.6.2" +solana-sdk = "1.6.2" [lib] crate-type = ["cdylib", "lib"] From 76aeeade53154089de2056e5ed53fa0c99006fdb Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Thu, 1 Apr 2021 01:03:49 -0600 Subject: [PATCH 41/92] spl-memo: Add back v1 program ID as `spl_memo::v1::id()` --- program/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/program/src/lib.rs b/program/src/lib.rs index 4f3b5d29..c4665f36 100644 --- a/program/src/lib.rs +++ b/program/src/lib.rs @@ -13,6 +13,11 @@ use solana_program::{ pubkey::Pubkey, }; +/// Legacy symbols from Memo v1 +pub mod v1 { + solana_program::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo"); +} + solana_program::declare_id!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"); /// Build a memo instruction, possibly signed From 5b61638b200198195901b2468f8d43f8bb180249 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Sat, 3 Apr 2021 12:36:00 -0600 Subject: [PATCH 42/92] Ignore compute-budget test to unblock bpf-tools v1.5 (#1569) --- program/tests/functional.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/program/tests/functional.rs b/program/tests/functional.rs index 5158d02e..c5ef6d90 100644 --- a/program/tests/functional.rs +++ b/program/tests/functional.rs @@ -117,6 +117,7 @@ async fn test_memo_signing() { } #[tokio::test] +#[ignore] async fn test_memo_compute_limits() { let (mut banks_client, payer, recent_blockhash) = program_test().start().await; From 85916d368bec84e68ad96103ac3bfe6541d49126 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Mon, 5 Apr 2021 14:22:05 -0600 Subject: [PATCH 43/92] Bump memo to v3.0.1 (#1574) --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 5a75bd1c..752027dc 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spl-memo" -version = "3.0.0" +version = "3.0.1" description = "Solana Program Library Memo" authors = ["Solana Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" From b2a680ac722ab9475af5a5221c5d362d260823ca Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 23 Apr 2021 12:31:36 -0700 Subject: [PATCH 44/92] Update SPL to Solana v1.6.6 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 752027dc..280847cb 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.6.2" +solana-program = "1.6.6" [dev-dependencies] -solana-program-test = "1.6.2" -solana-sdk = "1.6.2" +solana-program-test = "1.6.6" +solana-sdk = "1.6.6" [lib] crate-type = ["cdylib", "lib"] From d76caea3f250ed8a7838250b30d7a02f95e82812 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Tue, 4 May 2021 22:03:15 -0600 Subject: [PATCH 45/92] Bump solana crates to v1.6.7 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 280847cb..b7cbf76e 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.6.6" +solana-program = "1.6.7" [dev-dependencies] -solana-program-test = "1.6.6" -solana-sdk = "1.6.6" +solana-program-test = "1.6.7" +solana-sdk = "1.6.7" [lib] crate-type = ["cdylib", "lib"] From b376545818c1e195be733fe42c3c6a34b4f9dc70 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Mon, 14 Jun 2021 14:44:58 -0600 Subject: [PATCH 46/92] Bump solana version --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index b7cbf76e..babb45c5 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.6.7" +solana-program = "1.6.11" [dev-dependencies] -solana-program-test = "1.6.7" -solana-sdk = "1.6.7" +solana-program-test = "1.6.11" +solana-sdk = "1.6.11" [lib] crate-type = ["cdylib", "lib"] From 1384e4b36f76020eb479487b36f69362d0962564 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Fri, 25 Jun 2021 00:39:08 +0200 Subject: [PATCH 47/92] Update all solana dependencies to 1.7.3, fix issues (#1958) * Update all dependencies to 1.7.3, fix issues * Remove esm from mocha * Fix missed token test * Also update rust version * token-swap: update tolerance on sim test * Run `cargo clippy --fix` for needless_borrow errors * Rerun cargo fmt --- program/src/Cargo.toml | 6 +++--- program/src/processor.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index babb45c5..7fae01ca 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.6.11" +solana-program = "1.7.3" [dev-dependencies] -solana-program-test = "1.6.11" -solana-sdk = "1.6.11" +solana-program-test = "1.7.3" +solana-sdk = "1.7.3" [lib] crate-type = ["cdylib", "lib"] diff --git a/program/src/processor.rs b/program/src/processor.rs index f1cb19d9..baf64b82 100644 --- a/program/src/processor.rs +++ b/program/src/processor.rs @@ -52,7 +52,7 @@ mod tests { let emoji = "🐆".as_bytes(); let bytes = [0xF0, 0x9F, 0x90, 0x86]; assert_eq!(emoji, bytes); - assert_eq!(Ok(()), process_instruction(&program_id, &[], &emoji)); + assert_eq!(Ok(()), process_instruction(&program_id, &[], emoji)); let mut bad_utf8 = bytes; bad_utf8[3] = 0xFF; // Invalid UTF-8 byte From 5389abe00a4087b404c95a37a6fde35018113a32 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Fri, 2 Jul 2021 10:53:41 -0600 Subject: [PATCH 48/92] Bump solana and borsh crates (#2015) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 7fae01ca..0b50163f 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.7.3" +solana-program = "1.7.4" [dev-dependencies] -solana-program-test = "1.7.3" -solana-sdk = "1.7.3" +solana-program-test = "1.7.4" +solana-sdk = "1.7.4" [lib] crate-type = ["cdylib", "lib"] From 291a189d875a9c6764ca578a5176f398ad44a7d7 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Fri, 23 Jul 2021 10:47:06 -0600 Subject: [PATCH 49/92] Bump solana crates (#2139) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 0b50163f..711b8f73 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.7.4" +solana-program = "1.7.7" [dev-dependencies] -solana-program-test = "1.7.4" -solana-sdk = "1.7.4" +solana-program-test = "1.7.7" +solana-sdk = "1.7.7" [lib] crate-type = ["cdylib", "lib"] From f4ae2b728817b73d079547dcb59fa3e068369d0f Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 30 Aug 2021 12:20:33 -0700 Subject: [PATCH 50/92] Upgrade to Solana 1.7.11 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 711b8f73..a4f20abe 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.7.7" +solana-program = "1.7.11" [dev-dependencies] -solana-program-test = "1.7.7" -solana-sdk = "1.7.7" +solana-program-test = "1.7.11" +solana-sdk = "1.7.11" [lib] crate-type = ["cdylib", "lib"] From 3be1b150dd581be3ed9e1d149611b22c95c80c60 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 12 Oct 2021 09:14:32 -0700 Subject: [PATCH 51/92] Upgrade to Solana 1.8.0 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index a4f20abe..8ce981e4 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.7.11" +solana-program = "1.8.0" [dev-dependencies] -solana-program-test = "1.7.11" -solana-sdk = "1.7.11" +solana-program-test = "1.8.0" +solana-sdk = "1.8.0" [lib] crate-type = ["cdylib", "lib"] From 0772327d711c9c9000bbf7416d598fe8d2bc0ebb Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 20 Oct 2021 22:20:12 -0700 Subject: [PATCH 52/92] Upgrade to Solana v1.8.1 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 8ce981e4..3d4b526e 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.8.0" +solana-program = "1.8.1" [dev-dependencies] -solana-program-test = "1.8.0" -solana-sdk = "1.8.0" +solana-program-test = "1.8.1" +solana-sdk = "1.8.1" [lib] crate-type = ["cdylib", "lib"] From a0ee46ef46ce2326ff46a8077eb0c7a465d42a66 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Tue, 28 Dec 2021 23:02:47 -0500 Subject: [PATCH 53/92] Update SDK to 1.9.2, fix warnings (#2674) * Update SDK to 1.9.2, fix warnings * Upgrade honggfuzz * Use `get_latest_blockhash` correctly --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 3d4b526e..499a33e2 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.8.1" +solana-program = "1.9.2" [dev-dependencies] -solana-program-test = "1.8.1" -solana-sdk = "1.8.1" +solana-program-test = "1.9.2" +solana-sdk = "1.9.2" [lib] crate-type = ["cdylib", "lib"] From ebdcedd5ca24e26521ecfa98062b6a9ee292ce3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Piotrowski?= Date: Wed, 29 Dec 2021 22:30:04 +0100 Subject: [PATCH 54/92] add test for memo (#2678) * add test for memo * add test for memo - fix clippy warning * add test for memo - review suggestions --- program/src/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/program/src/lib.rs b/program/src/lib.rs index c4665f36..53d80ddd 100644 --- a/program/src/lib.rs +++ b/program/src/lib.rs @@ -37,3 +37,18 @@ pub fn build_memo(memo: &[u8], signer_pubkeys: &[&Pubkey]) -> Instruction { data: memo.to_vec(), } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_build_memo() { + let signer_pubkey = Pubkey::new_unique(); + let memo = "🐆".as_bytes(); + let instruction = build_memo(memo, &[&signer_pubkey]); + assert_eq!(memo, instruction.data); + assert_eq!(instruction.accounts.len(), 1); + assert_eq!(instruction.accounts[0].pubkey, signer_pubkey); + } +} From 797eba62d33e03047c72c019573043d3d05b6291 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Fri, 21 Jan 2022 22:52:10 -0700 Subject: [PATCH 55/92] Bump solana crates to v1.9.5 (#2780) * Bump solana crates to v1.9.5 * Update sol_set_return_data type signature and un-ignore test --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 499a33e2..a5e92614 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.9.2" +solana-program = "1.9.5" [dev-dependencies] -solana-program-test = "1.9.2" -solana-sdk = "1.9.2" +solana-program-test = "1.9.5" +solana-sdk = "1.9.5" [lib] crate-type = ["cdylib", "lib"] From f7721930c4bc62344d5c167a2b39e4bbfe421aae Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Wed, 23 Feb 2022 16:20:55 -0700 Subject: [PATCH 56/92] Bump solana to v1.9.9 (#2902) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index a5e92614..5a4e21b9 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.9.5" +solana-program = "1.9.9" [dev-dependencies] -solana-program-test = "1.9.5" -solana-sdk = "1.9.5" +solana-program-test = "1.9.9" +solana-sdk = "1.9.9" [lib] crate-type = ["cdylib", "lib"] From 36231d990e23a33e09e7d58ec887e3f57efe0625 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Mon, 11 Apr 2022 22:25:27 +0200 Subject: [PATCH 57/92] Upgrade crates to 1.10.8 (#3076) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 5a4e21b9..31946d0f 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.9.9" +solana-program = "1.10.8" [dev-dependencies] -solana-program-test = "1.9.9" -solana-sdk = "1.9.9" +solana-program-test = "1.10.8" +solana-sdk = "1.10.8" [lib] crate-type = ["cdylib", "lib"] From a3d374c94748ef9013e0e687b33b6b721486e994 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Tue, 26 Apr 2022 14:15:26 -0400 Subject: [PATCH 58/92] Bump token-2022 (#3113) * Bump token-2022 * Bump solana dependencies --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 31946d0f..a77c0813 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.10.8" +solana-program = "1.10.10" [dev-dependencies] -solana-program-test = "1.10.8" -solana-sdk = "1.10.8" +solana-program-test = "1.10.10" +solana-sdk = "1.10.10" [lib] crate-type = ["cdylib", "lib"] From cdf8d55413cb4be35aa26a3825695e4c51b9fea3 Mon Sep 17 00:00:00 2001 From: Dmitri Makarov Date: Tue, 17 May 2022 11:27:30 -0700 Subject: [PATCH 59/92] Bump solana to v1.10.15 (#3176) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index a77c0813..55d50051 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.10.10" +solana-program = "1.10.15" [dev-dependencies] -solana-program-test = "1.10.10" -solana-sdk = "1.10.10" +solana-program-test = "1.10.15" +solana-sdk = "1.10.15" [lib] crate-type = ["cdylib", "lib"] From 313f7e203bcbfdbdcabccd74d228d8b955704157 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Fri, 1 Jul 2022 22:51:01 +0200 Subject: [PATCH 60/92] Update Solana crates to 1.10.29 (#3303) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 55d50051..e2612d0e 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.10.15" +solana-program = "1.10.29" [dev-dependencies] -solana-program-test = "1.10.15" -solana-sdk = "1.10.15" +solana-program-test = "1.10.29" +solana-sdk = "1.10.29" [lib] crate-type = ["cdylib", "lib"] From 5fb7cad009c6dd157b137fa8faee58d8fc5d8664 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Wed, 27 Jul 2022 10:28:14 -0700 Subject: [PATCH 61/92] Bump solana crates to v1.10.33 (#3385) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index e2612d0e..6a91bfd1 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.10.29" +solana-program = "1.10.33" [dev-dependencies] -solana-program-test = "1.10.29" -solana-sdk = "1.10.29" +solana-program-test = "1.10.33" +solana-sdk = "1.10.33" [lib] crate-type = ["cdylib", "lib"] From eb4b8af6b640b8d36d44924e8137406edd7b8528 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Tue, 16 Aug 2022 11:33:24 -0700 Subject: [PATCH 62/92] Bump solana to v1.10.35 (#3485) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 6a91bfd1..f876c984 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.10.33" +solana-program = "1.10.35" [dev-dependencies] -solana-program-test = "1.10.33" -solana-sdk = "1.10.33" +solana-program-test = "1.10.35" +solana-sdk = "1.10.35" [lib] crate-type = ["cdylib", "lib"] From 7c47740750483213b2d12bdbb36ba73e05efaca8 Mon Sep 17 00:00:00 2001 From: hana <81144685+2501babe@users.noreply.github.com> Date: Thu, 18 Aug 2022 12:16:02 -0700 Subject: [PATCH 63/92] Update rust to 1.60, solana to 1.11.6 (#3492) also change bpf to sbf throughout the codebase Co-authored-by: Jon Cinque --- program/src/Cargo.toml | 8 ++++---- program/tests/functional.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index f876c984..68ed9878 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -9,14 +9,14 @@ edition = "2018" [features] no-entrypoint = [] -test-bpf = [] +test-sbf = [] [dependencies] -solana-program = "1.10.35" +solana-program = "1.11.6" [dev-dependencies] -solana-program-test = "1.10.35" -solana-sdk = "1.10.35" +solana-program-test = "1.11.6" +solana-sdk = "1.11.6" [lib] crate-type = ["cdylib", "lib"] diff --git a/program/tests/functional.rs b/program/tests/functional.rs index c5ef6d90..befbe56a 100644 --- a/program/tests/functional.rs +++ b/program/tests/functional.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "test-bpf")] +#![cfg(feature = "test-sbf")] use solana_program::{ instruction::{AccountMeta, Instruction, InstructionError}, From 83025250207032e64c8dab05568ee1ecbbd780c2 Mon Sep 17 00:00:00 2001 From: hanako mumei <81144685+2501babe@users.noreply.github.com> Date: Tue, 11 Oct 2022 12:04:28 -0700 Subject: [PATCH 64/92] update solana to 1.14.4 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 68ed9878..e3cdccd1 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.11.6" +solana-program = "1.14.4" [dev-dependencies] -solana-program-test = "1.11.6" -solana-sdk = "1.11.6" +solana-program-test = "1.14.4" +solana-sdk = "1.14.4" [lib] crate-type = ["cdylib", "lib"] From 07610dba73d3fe215f4dfc4897a45b195ab7b74f Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Thu, 27 Oct 2022 07:59:25 +0900 Subject: [PATCH 65/92] upgrade solana-program to 1.14.6 (#3765) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index e3cdccd1..6eddb42d 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.14.4" +solana-program = "1.14.6" [dev-dependencies] -solana-program-test = "1.14.4" -solana-sdk = "1.14.4" +solana-program-test = "1.14.6" +solana-sdk = "1.14.6" [lib] crate-type = ["cdylib", "lib"] From c5d527d23e56c03f69be6620c87639ea7dd1d969 Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Tue, 6 Dec 2022 12:59:00 +0900 Subject: [PATCH 66/92] update solana to 1.14.10 (#3872) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 6eddb42d..16f47a4a 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.14.6" +solana-program = "1.14.10" [dev-dependencies] -solana-program-test = "1.14.6" -solana-sdk = "1.14.6" +solana-program-test = "1.14.10" +solana-sdk = "1.14.10" [lib] crate-type = ["cdylib", "lib"] From 8b9d5b56b53248548902afe0d911c35f78c8e6c0 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Tue, 13 Dec 2022 23:46:26 +0100 Subject: [PATCH 67/92] Update repo to `edition = "2021"` (#3900) --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 16f47a4a..1cd3621e 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -5,7 +5,7 @@ description = "Solana Program Library Memo" authors = ["Solana Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" license = "Apache-2.0" -edition = "2018" +edition = "2021" [features] no-entrypoint = [] From b1e1d31336793caeafec28244d7d7b7880d6c5d3 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Thu, 19 Jan 2023 21:47:03 +0100 Subject: [PATCH 68/92] ci: Update repo to Solana 1.14.12 (#3989) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 1cd3621e..c2a9da75 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.14.10" +solana-program = "1.14.12" [dev-dependencies] -solana-program-test = "1.14.10" -solana-sdk = "1.14.10" +solana-program-test = "1.14.12" +solana-sdk = "1.14.12" [lib] crate-type = ["cdylib", "lib"] From c9e85032064fdef2f8defeedc1ab3002b38985c2 Mon Sep 17 00:00:00 2001 From: joeaba <77398477+joeaba@users.noreply.github.com> Date: Tue, 31 Jan 2023 08:06:36 -0500 Subject: [PATCH 69/92] chore: update maintainer references (#4008) --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index c2a9da75..01e09cfa 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -2,7 +2,7 @@ name = "spl-memo" version = "3.0.1" description = "Solana Program Library Memo" -authors = ["Solana Maintainers "] +authors = ["Solana Labs Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" license = "Apache-2.0" edition = "2021" From e7f9a8818086bf9c5f17660021292e359e76d981 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Mon, 26 Jun 2023 14:42:02 +0200 Subject: [PATCH 70/92] Update Solana to 1.16.1 and Rust to 1.69 (#4592) #### Problem The 1.16 Solana crates are out, but SPL is still on 1.14 and needs the new functionality. #### Solution Update the: * rust version to 1.69 * nightly to 2023-04-19 * solana tools to 1.16.1 * solana crates to 1.16.1 * borsh to 0.10 And fix: * new clippy warnings * deprecated warnings in the new solana crates --- program/src/Cargo.toml | 6 +++--- program/src/processor.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 01e09cfa..0402245b 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.14.12" +solana-program = "1.16.1" [dev-dependencies] -solana-program-test = "1.14.12" -solana-sdk = "1.14.12" +solana-program-test = "1.16.1" +solana-sdk = "1.16.1" [lib] crate-type = ["cdylib", "lib"] diff --git a/program/src/processor.rs b/program/src/processor.rs index baf64b82..f815c09b 100644 --- a/program/src/processor.rs +++ b/program/src/processor.rs @@ -44,7 +44,7 @@ mod tests { #[test] fn test_utf8_memo() { - let program_id = Pubkey::new(&[0; 32]); + let program_id = Pubkey::new_from_array([0; 32]); let string = b"letters and such"; assert_eq!(Ok(()), process_instruction(&program_id, &[], string)); @@ -64,7 +64,7 @@ mod tests { #[test] fn test_signers() { - let program_id = Pubkey::new(&[0; 32]); + let program_id = Pubkey::new_from_array([0; 32]); let memo = "🐆".as_bytes(); let pubkey0 = Pubkey::new_unique(); From 128d25dd2e6211a7a8cd60a0997939c9707dfbc3 Mon Sep 17 00:00:00 2001 From: Joe C Date: Tue, 27 Jun 2023 14:31:04 -0400 Subject: [PATCH 71/92] bump/memo (#4635) --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 0402245b..188bf725 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spl-memo" -version = "3.0.1" +version = "4.0.0" description = "Solana Program Library Memo" authors = ["Solana Labs Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" From 88815432be70e5fd09816fb5d9494ecbea9883ed Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Thu, 13 Jul 2023 11:06:07 +0900 Subject: [PATCH 72/92] Upgrade to solana 1.16.3 (#4679) * upgrade to solana 1.16.3 * bring down hashbrown dependency to 0.12.3 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 188bf725..a6e79287 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.16.1" +solana-program = "1.16.3" [dev-dependencies] -solana-program-test = "1.16.1" -solana-sdk = "1.16.1" +solana-program-test = "1.16.3" +solana-sdk = "1.16.3" [lib] crate-type = ["cdylib", "lib"] From 669f111007ee7301162569a5f0d1ea09ea3e0542 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Thu, 21 Sep 2023 10:44:57 +0200 Subject: [PATCH 73/92] Bump repo to 1.16.13 (#5324) * Run update script * Update everything to use non-deprecated functions --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index a6e79287..01ac6fec 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.16.3" +solana-program = "1.16.13" [dev-dependencies] -solana-program-test = "1.16.3" -solana-sdk = "1.16.3" +solana-program-test = "1.16.13" +solana-sdk = "1.16.13" [lib] crate-type = ["cdylib", "lib"] From ed03d65306df63feca85245b23334081613f9127 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Tue, 10 Oct 2023 21:02:47 -0400 Subject: [PATCH 74/92] chore: Bump Solana crates to 1.16.16 (#5494) --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 01ac6fec..42018ec9 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.16.13" +solana-program = "1.16.16" [dev-dependencies] -solana-program-test = "1.16.13" -solana-sdk = "1.16.13" +solana-program-test = "1.16.16" +solana-sdk = "1.16.16" [lib] crate-type = ["cdylib", "lib"] From 75a1b69843c0e28696a73d7bccd6fcb70b3e0610 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Thu, 19 Oct 2023 18:04:18 +0200 Subject: [PATCH 75/92] ci: Bump repo to Solana 1.17 (#5575) * Update workspace for new cargo resolver, remove ntapi patch * Update Rust versions * Update dependencies with `./update-solana-dependencies.sh 1.17.2` * Update lockfile * Fix build errors * Run clippy with `--fix` * concurrent-merkle-tree: Fix function to not use mutable ref * Replace StakeState with StakeStateV2 * governance: Fix clippy lint * governance: Fix unnecessary mut * Allow `clippy::items_after_module` * token: Make error tests clearer * token-2022: Fix private glob re-export * token-upgrade-cli: Replace validator with parser * single-pool-cli: Fix parsers * ci: Update clippy command * Update anchor version * token-metadata: Use `no-entrypoint` feature in token-2022 * ci: Add protobuf-compiler to build deps * discriminator-syn: *Don't* specify type of lib to build * ci: Blast directories in cargo-build-test * account-compression: Update build and lockfile * Update token-group and feature-gate * single-pool: revert WrongStakeStateV2 * stake-pool: revert WrongStakeStateV2 * stake-pool-py: revert StakeStateV2 --------- Co-authored-by: hanako mumei <81144685+2501babe@users.noreply.github.com> --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 42018ec9..ea14b889 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.16.16" +solana-program = "1.17.2" [dev-dependencies] -solana-program-test = "1.16.16" -solana-sdk = "1.16.16" +solana-program-test = "1.17.2" +solana-sdk = "1.17.2" [lib] crate-type = ["cdylib", "lib"] From c5ab89e4159d884e7bac2df4e11962646d18922a Mon Sep 17 00:00:00 2001 From: Joe C Date: Wed, 8 Nov 2023 20:36:07 +0000 Subject: [PATCH 76/92] rustfmt: use entrypoint full path This PR swaps any calls to the `entrypoint!` macro with the full path, ie: `solana_program::entrypoint!`. This will play a role in the effort to introduce a linting standard to SPL. --- program/src/entrypoint.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/program/src/entrypoint.rs b/program/src/entrypoint.rs index 82641a41..8876e45b 100644 --- a/program/src/entrypoint.rs +++ b/program/src/entrypoint.rs @@ -2,11 +2,9 @@ #![cfg(not(feature = "no-entrypoint"))] -use solana_program::{ - account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, pubkey::Pubkey, -}; +use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey}; -entrypoint!(process_instruction); +solana_program::entrypoint!(process_instruction); fn process_instruction( program_id: &Pubkey, accounts: &[AccountInfo], From d01e5708c3dfc47aad6ffd751ae5facb21d799f2 Mon Sep 17 00:00:00 2001 From: Joe C Date: Wed, 8 Nov 2023 20:38:31 +0000 Subject: [PATCH 77/92] rustfmt: format imports This PR adds import formatting configurations to the repository's `rustfmt.toml` file, and the associated changes from `cargo +nightly fmt --all`. --- program/src/processor.rs | 20 ++++++++++++-------- program/tests/functional.rs | 20 +++++++++++--------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/program/src/processor.rs b/program/src/processor.rs index f815c09b..57ca6ba3 100644 --- a/program/src/processor.rs +++ b/program/src/processor.rs @@ -1,10 +1,12 @@ //! Program state processor -use solana_program::{ - account_info::AccountInfo, entrypoint::ProgramResult, msg, program_error::ProgramError, - pubkey::Pubkey, +use { + solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, msg, program_error::ProgramError, + pubkey::Pubkey, + }, + std::str::from_utf8, }; -use std::str::from_utf8; /// Instruction processor pub fn process_instruction( @@ -36,11 +38,13 @@ pub fn process_instruction( #[cfg(test)] mod tests { - use super::*; - use solana_program::{ - account_info::IntoAccountInfo, program_error::ProgramError, pubkey::Pubkey, + use { + super::*, + solana_program::{ + account_info::IntoAccountInfo, program_error::ProgramError, pubkey::Pubkey, + }, + solana_sdk::account::Account, }; - use solana_sdk::account::Account; #[test] fn test_utf8_memo() { diff --git a/program/tests/functional.rs b/program/tests/functional.rs index befbe56a..763f639f 100644 --- a/program/tests/functional.rs +++ b/program/tests/functional.rs @@ -1,15 +1,17 @@ #![cfg(feature = "test-sbf")] -use solana_program::{ - instruction::{AccountMeta, Instruction, InstructionError}, - pubkey::Pubkey, +use { + solana_program::{ + instruction::{AccountMeta, Instruction, InstructionError}, + pubkey::Pubkey, + }, + solana_program_test::*, + solana_sdk::{ + signature::{Keypair, Signer}, + transaction::{Transaction, TransactionError}, + }, + spl_memo::*, }; -use solana_program_test::*; -use solana_sdk::{ - signature::{Keypair, Signer}, - transaction::{Transaction, TransactionError}, -}; -use spl_memo::*; fn program_test() -> ProgramTest { ProgramTest::new("spl_memo", id(), processor!(processor::process_instruction)) From 4a111bc1a7210a007d7f29832c05219644e94cb4 Mon Sep 17 00:00:00 2001 From: Joe C Date: Wed, 8 Nov 2023 20:41:36 +0000 Subject: [PATCH 78/92] rustfmt: format comments This PR adds comment formatting configurations to the repository's `rustfmt.toml` file, and the associated changes from `cargo +nightly fmt --all`. Comment width 80. --- program/src/lib.rs | 13 +++++++------ program/tests/functional.rs | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/program/src/lib.rs b/program/src/lib.rs index 53d80ddd..fa792b8b 100644 --- a/program/src/lib.rs +++ b/program/src/lib.rs @@ -1,12 +1,14 @@ #![deny(missing_docs)] -//! A program that accepts a string of encoded characters and verifies that it parses, -//! while verifying and logging signers. Currently handles UTF-8 characters. +//! A program that accepts a string of encoded characters and verifies that it +//! parses, while verifying and logging signers. Currently handles UTF-8 +//! characters. mod entrypoint; pub mod processor; -// Export current sdk types for downstream users building with a different sdk version +// Export current sdk types for downstream users building with a different sdk +// version pub use solana_program; use solana_program::{ instruction::{AccountMeta, Instruction}, @@ -24,9 +26,8 @@ solana_program::declare_id!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"); /// /// Accounts expected by this instruction: /// -/// 0. ..0+N. `[signer]` Expected signers; if zero provided, instruction will be processed as a -/// normal, unsigned spl-memo -/// +/// 0. ..0+N. `[signer]` Expected signers; if zero provided, instruction will +/// be processed as a normal, unsigned spl-memo pub fn build_memo(memo: &[u8], signer_pubkeys: &[&Pubkey]) -> Instruction { Instruction { program_id: id(), diff --git a/program/tests/functional.rs b/program/tests/functional.rs index 763f639f..91fef7e1 100644 --- a/program/tests/functional.rs +++ b/program/tests/functional.rs @@ -42,7 +42,8 @@ async fn test_memo_signing() { transaction.sign(&[&payer], recent_blockhash); banks_client.process_transaction(transaction).await.unwrap(); - // Demonstrate success on signature provided, regardless of specific memo AccountMeta + // Demonstrate success on signature provided, regardless of specific memo + // AccountMeta let mut transaction = Transaction::new_with_payer( &[Instruction { program_id: id(), From 75b07bd0c7d6415125d15599797d232f54260553 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Wed, 29 Nov 2023 12:55:07 +0100 Subject: [PATCH 79/92] repo: Update to 1.17.6 (#5863) * repo: Update to 1.17.6 with script * Update lockfile * Remove disabling feature in token-cli tests --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index ea14b889..49900d65 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.17.2" +solana-program = "1.17.6" [dev-dependencies] -solana-program-test = "1.17.2" -solana-sdk = "1.17.2" +solana-program-test = "1.17.6" +solana-sdk = "1.17.6" [lib] crate-type = ["cdylib", "lib"] From c7199115b050d23138214cabb77218cc9d43de09 Mon Sep 17 00:00:00 2001 From: Emanuele Cesena Date: Wed, 17 Jan 2024 17:03:22 -0800 Subject: [PATCH 80/92] token 2022: upgrade sdk to 1.17.13 (#6147) * token 2022: upgrade sdk to 1.17.13 * Upgrade all remaining packages --------- Co-authored-by: Jon C --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 49900d65..da01c4b9 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.17.6" +solana-program = "1.17.13" [dev-dependencies] -solana-program-test = "1.17.6" -solana-sdk = "1.17.6" +solana-program-test = "1.17.13" +solana-sdk = "1.17.13" [lib] crate-type = ["cdylib", "lib"] From 9381c0cb68f86bcf8faf9915b11b120d9cb9ec1f Mon Sep 17 00:00:00 2001 From: Will Hickey Date: Fri, 26 Jan 2024 15:31:55 -0600 Subject: [PATCH 81/92] Update solana dependency version to allow 2.0.0 (#6182) * Update solana dependency version to allow 2.0.0 * Fix version number in solana-version.sh * Fix version numbers * Revert solana-version.sh with note * Revert Anchor version change * Relax dependency version upper bound to 2 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index da01c4b9..bf73a41c 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "1.17.13" +solana-program = ">=1.17.13,<=2" [dev-dependencies] -solana-program-test = "1.17.13" -solana-sdk = "1.17.13" +solana-program-test = ">=1.17.13,<=2" +solana-sdk = ">=1.17.13,<=2" [lib] crate-type = ["cdylib", "lib"] From 6f7fc297b614538b51f6afceb971e7730011dd24 Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Thu, 1 Feb 2024 10:09:45 +0900 Subject: [PATCH 82/92] Upgrade to solana 1.17.17 (#6189) * upgrade to solana version 1.17.17 * add display for the group extensions * upgrade to solana version 1.17.17 * update cargo lock --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index bf73a41c..f71b83e7 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = ">=1.17.13,<=2" +solana-program = ">=1.17.17,<=2" [dev-dependencies] -solana-program-test = ">=1.17.13,<=2" -solana-sdk = ">=1.17.13,<=2" +solana-program-test = ">=1.17.17,<=2" +solana-sdk = ">=1.17.17,<=2" [lib] crate-type = ["cdylib", "lib"] From d916d1a607059a891c775ac77efb5f01e19b9507 Mon Sep 17 00:00:00 2001 From: Will Hickey Date: Mon, 5 Feb 2024 14:52:18 -0600 Subject: [PATCH 83/92] Bump SPL crate versions (#6221) * Update associated-token-account version to 2.3.1 * Update discriminator version to 0.1.1 * Update discriminator-derive version to 0.1.2 * Update discriminator-syn version to 0.1.2 * Update instruction-padding version to 0.1.1 * Update memo version to 4.0.1 * Update pod version to 0.1.1 * Update program-error version to 0.3.1 * Update program-error-derive version to 0.3.2 * Update tlv-account-resolution version to 0.5.2 * Update token version to 4.0.1 * Cargo.lock * Update token-group-interface version to 0.1.1 * Update token-metadata-interface version to 0.2.1 * Update transfer-hook-interface version to 0.5.1 * Update type-length-value version to 0.3.1 * Cargo.lock * Remove extraneous whitespace --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index f71b83e7..09414653 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spl-memo" -version = "4.0.0" +version = "4.0.1" description = "Solana Program Library Memo" authors = ["Solana Labs Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" From 22dc1a707777d612cd5edf4687b273d4b0d824f1 Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Thu, 29 Feb 2024 10:06:27 +0900 Subject: [PATCH 84/92] Upgrade to Solana 1.18.2 (#6278) * upgrade to solana 1.18.2 * upgrade rust version to 1.76.0 * update borsh to 1.2.1 * replace deprecated `try_to_vec` with `borsh::to_vec` * temporarily allow deprecated functions in cli that uses clap-v3 * use `repr(u32)` for enums in token lending --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 09414653..6d006f4e 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = ">=1.17.17,<=2" +solana-program = ">=1.18.2,<=2" [dev-dependencies] -solana-program-test = ">=1.17.17,<=2" -solana-sdk = ">=1.17.17,<=2" +solana-program-test = ">=1.18.2,<=2" +solana-sdk = ">=1.18.2,<=2" [lib] crate-type = ["cdylib", "lib"] From 757977022d4c73e82ef9fcc61cfbeee5557249b9 Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Wed, 24 Apr 2024 12:01:47 +0900 Subject: [PATCH 85/92] Bump solana version to 1.18.11 (#6624) upgrade solana version to 1.18.11 --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 6d006f4e..a7d401eb 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = ">=1.18.2,<=2" +solana-program = ">=1.18.11,<=2" [dev-dependencies] -solana-program-test = ">=1.18.2,<=2" -solana-sdk = ">=1.18.2,<=2" +solana-program-test = ">=1.18.11,<=2" +solana-sdk = ">=1.18.11,<=2" [lib] crate-type = ["cdylib", "lib"] From f316da3601717491ae3e56e9d1ed3718e2c62ce5 Mon Sep 17 00:00:00 2001 From: Jon C Date: Tue, 25 Jun 2024 11:11:23 +0200 Subject: [PATCH 86/92] deps: Upgrade to Solana v2 (#6908) * solana: Update deps to 2.0.0 * Update lockfile * Update toolchain version * Update nightly version * Fix check issues * Fix clippy * Revert upgrade for account compression libs * Install build deps for serde test * Fixup versions * Fixup twoxtx build * Revert solana install version * Actually, get version 2.0.0 from the correct place --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index a7d401eb..cc91eddc 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = ">=1.18.11,<=2" +solana-program = "2.0.0" [dev-dependencies] -solana-program-test = ">=1.18.11,<=2" -solana-sdk = ">=1.18.11,<=2" +solana-program-test = "2.0.0" +solana-sdk = "2.0.0" [lib] crate-type = ["cdylib", "lib"] From 3576a28d11ee9bee1776151672fb74b0549b14f9 Mon Sep 17 00:00:00 2001 From: Jon C Date: Tue, 25 Jun 2024 12:04:52 +0200 Subject: [PATCH 87/92] memo: Bump to 5.0.0 for Solana v2 support (#6913) --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index cc91eddc..762fc447 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spl-memo" -version = "4.0.1" +version = "5.0.0" description = "Solana Program Library Memo" authors = ["Solana Labs Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" From b9a0d2b41fe1b905332a3c16068c601c933ddca5 Mon Sep 17 00:00:00 2001 From: Jon C Date: Thu, 25 Jul 2024 16:53:13 +0200 Subject: [PATCH 88/92] ci: Bump crates to Solana 2.0.3 (#7047) * Run script * Update lockfile * Use "processed" instead of deprecated "recent" * Fixup account compression tests * account-compression: Remove `only` in test --- program/src/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 762fc447..cdfd83a4 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "2.0.0" +solana-program = "2.0.3" [dev-dependencies] -solana-program-test = "2.0.0" -solana-sdk = "2.0.0" +solana-program-test = "2.0.3" +solana-sdk = "2.0.3" [lib] crate-type = ["cdylib", "lib"] From 9b23d9aae416c0aca4e021ef7f05f4ffd0430ec5 Mon Sep 17 00:00:00 2001 From: Jon C Date: Thu, 31 Oct 2024 12:25:30 +0100 Subject: [PATCH 89/92] CI: Update to Solana v2.1 crates (#7416) * Run update script, update curve25519-dalek dep, rust * Run clippy + fmt * Add workspace lints, start fixing doc comments * Update doc comments for clippy * Re-run cargo fmt after doc comment update * Update solana-version * Update CI jobs --- program/src/Cargo.toml | 6 +++--- program/src/lib.rs | 2 +- program/tests/functional.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index cdfd83a4..6b56bb5d 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "2.0.3" +solana-program = "2.1.0" [dev-dependencies] -solana-program-test = "2.0.3" -solana-sdk = "2.0.3" +solana-program-test = "2.1.0" +solana-sdk = "2.1.0" [lib] crate-type = ["cdylib", "lib"] diff --git a/program/src/lib.rs b/program/src/lib.rs index fa792b8b..b92e480a 100644 --- a/program/src/lib.rs +++ b/program/src/lib.rs @@ -27,7 +27,7 @@ solana_program::declare_id!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"); /// Accounts expected by this instruction: /// /// 0. ..0+N. `[signer]` Expected signers; if zero provided, instruction will -/// be processed as a normal, unsigned spl-memo +/// be processed as a normal, unsigned spl-memo pub fn build_memo(memo: &[u8], signer_pubkeys: &[&Pubkey]) -> Instruction { Instruction { program_id: id(), diff --git a/program/tests/functional.rs b/program/tests/functional.rs index 91fef7e1..c2ea742d 100644 --- a/program/tests/functional.rs +++ b/program/tests/functional.rs @@ -20,7 +20,7 @@ fn program_test() -> ProgramTest { #[tokio::test] async fn test_memo_signing() { let memo = "🐆".as_bytes(); - let (mut banks_client, payer, recent_blockhash) = program_test().start().await; + let (banks_client, payer, recent_blockhash) = program_test().start().await; let keypairs = vec![Keypair::new(), Keypair::new(), Keypair::new()]; let pubkeys: Vec = keypairs.iter().map(|keypair| keypair.pubkey()).collect(); @@ -122,7 +122,7 @@ async fn test_memo_signing() { #[tokio::test] #[ignore] async fn test_memo_compute_limits() { - let (mut banks_client, payer, recent_blockhash) = program_test().start().await; + let (banks_client, payer, recent_blockhash) = program_test().start().await; // Test memo length let mut memo = vec![]; From fa02e7ddac77001f6ff36a5be793dad1b4f1c2b9 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Thu, 31 Oct 2024 21:51:00 +0400 Subject: [PATCH 90/92] remove solana-program from spl-memo (#7429) * remove solana-program from spl-memo * fix imports in tests * fix more test imports * fmt --- program/src/Cargo.toml | 7 ++++++- program/src/entrypoint.rs | 7 +++++-- program/src/lib.rs | 15 +++++++++------ program/src/processor.rs | 14 ++++---------- program/tests/functional.rs | 6 ++---- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index 6b56bb5d..b38414fe 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -12,7 +12,12 @@ no-entrypoint = [] test-sbf = [] [dependencies] -solana-program = "2.1.0" +solana-account-info = "2.1.0" +solana-instruction = "2.1.0" +solana-msg = "2.1.0" +solana-program-entrypoint = "2.1.0" +solana-program-error = "2.1.0" +solana-pubkey = "2.1.0" [dev-dependencies] solana-program-test = "2.1.0" diff --git a/program/src/entrypoint.rs b/program/src/entrypoint.rs index 8876e45b..09ae9409 100644 --- a/program/src/entrypoint.rs +++ b/program/src/entrypoint.rs @@ -2,9 +2,12 @@ #![cfg(not(feature = "no-entrypoint"))] -use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey}; +use { + solana_account_info::AccountInfo, solana_program_entrypoint::ProgramResult, + solana_pubkey::Pubkey, +}; -solana_program::entrypoint!(process_instruction); +solana_program_entrypoint::entrypoint!(process_instruction); fn process_instruction( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/program/src/lib.rs b/program/src/lib.rs index b92e480a..898167a7 100644 --- a/program/src/lib.rs +++ b/program/src/lib.rs @@ -9,18 +9,21 @@ pub mod processor; // Export current sdk types for downstream users building with a different sdk // version -pub use solana_program; -use solana_program::{ - instruction::{AccountMeta, Instruction}, - pubkey::Pubkey, +pub use { + solana_account_info, solana_instruction, solana_msg, solana_program_entrypoint, + solana_program_error, solana_pubkey, +}; +use { + solana_instruction::{AccountMeta, Instruction}, + solana_pubkey::Pubkey, }; /// Legacy symbols from Memo v1 pub mod v1 { - solana_program::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo"); + solana_pubkey::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo"); } -solana_program::declare_id!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"); +solana_pubkey::declare_id!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"); /// Build a memo instruction, possibly signed /// diff --git a/program/src/processor.rs b/program/src/processor.rs index 57ca6ba3..618290ad 100644 --- a/program/src/processor.rs +++ b/program/src/processor.rs @@ -1,11 +1,8 @@ //! Program state processor use { - solana_program::{ - account_info::AccountInfo, entrypoint::ProgramResult, msg, program_error::ProgramError, - pubkey::Pubkey, - }, - std::str::from_utf8, + solana_account_info::AccountInfo, solana_msg::msg, solana_program_entrypoint::ProgramResult, + solana_program_error::ProgramError, solana_pubkey::Pubkey, std::str::from_utf8, }; /// Instruction processor @@ -39,11 +36,8 @@ pub fn process_instruction( #[cfg(test)] mod tests { use { - super::*, - solana_program::{ - account_info::IntoAccountInfo, program_error::ProgramError, pubkey::Pubkey, - }, - solana_sdk::account::Account, + super::*, solana_account_info::IntoAccountInfo, solana_program_error::ProgramError, + solana_pubkey::Pubkey, solana_sdk::account::Account, }; #[test] diff --git a/program/tests/functional.rs b/program/tests/functional.rs index c2ea742d..c8a05e1b 100644 --- a/program/tests/functional.rs +++ b/program/tests/functional.rs @@ -1,11 +1,9 @@ #![cfg(feature = "test-sbf")] use { - solana_program::{ - instruction::{AccountMeta, Instruction, InstructionError}, - pubkey::Pubkey, - }, + solana_instruction::{error::InstructionError, AccountMeta, Instruction}, solana_program_test::*, + solana_pubkey::Pubkey, solana_sdk::{ signature::{Keypair, Signer}, transaction::{Transaction, TransactionError}, From 2c2bf7986060f856efcccaf76563889e87a7b66c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:10:12 +0000 Subject: [PATCH 91/92] Publish spl-memo v6.0.0 --- program/src/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/Cargo.toml b/program/src/Cargo.toml index b38414fe..7631d51b 100644 --- a/program/src/Cargo.toml +++ b/program/src/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spl-memo" -version = "5.0.0" +version = "6.0.0" description = "Solana Program Library Memo" authors = ["Solana Labs Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" From e66d0649447345572063bb23738b271cc0a12f44 Mon Sep 17 00:00:00 2001 From: Jon C Date: Tue, 19 Nov 2024 13:12:42 +0100 Subject: [PATCH 92/92] Oops, move Cargo.toml from program/src/ to program/ --- program/{src => }/Cargo.toml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename program/{src => }/Cargo.toml (100%) diff --git a/program/src/Cargo.toml b/program/Cargo.toml similarity index 100% rename from program/src/Cargo.toml rename to program/Cargo.toml