From f9d1935316ecf7f475220aa518c1d05c08fb4034 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Thu, 20 Jun 2024 06:08:19 +0900 Subject: [PATCH] program: move itertools to dev-dependencies (#1782) * port join from itertools and use it in program_stubs.rs * move itertools to dev-dependencies of solana-program * add comment to join fn * more concise replacement for join fn Co-authored-by: Jon C * remove join fn --------- Co-authored-by: Jon C --- programs/sbf/Cargo.lock | 1 - sdk/program/Cargo.toml | 3 +-- sdk/program/src/program_stubs.rs | 7 +++++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 6dadcdaf1a54b7..5dc8cc9069195d 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -5291,7 +5291,6 @@ dependencies = [ "console_log", "curve25519-dalek", "getrandom 0.2.10", - "itertools 0.12.1", "js-sys", "lazy_static", "libsecp256k1 0.6.0", diff --git a/sdk/program/Cargo.toml b/sdk/program/Cargo.toml index e2f5085ac0d0bf..57819881b70d06 100644 --- a/sdk/program/Cargo.toml +++ b/sdk/program/Cargo.toml @@ -19,7 +19,6 @@ borsh0-10 = { package = "borsh", version = "0.10.3", optional = true } bs58 = { workspace = true } bv = { workspace = true, features = ["serde"] } bytemuck = { workspace = true, features = ["derive"] } -itertools = { workspace = true } lazy_static = { workspace = true } log = { workspace = true } memoffset = { workspace = true } @@ -53,7 +52,6 @@ ark-serialize = { workspace = true } base64 = { workspace = true, features = ["alloc", "std"] } bitflags = { workspace = true } curve25519-dalek = { workspace = true } -itertools = { workspace = true } libsecp256k1 = { workspace = true } num-bigint = { workspace = true } rand = { workspace = true } @@ -77,6 +75,7 @@ parking_lot = { workspace = true } anyhow = { workspace = true } array-bytes = { workspace = true } assert_matches = { workspace = true } +itertools = { workspace = true } serde_json = { workspace = true } static_assertions = { workspace = true } diff --git a/sdk/program/src/program_stubs.rs b/sdk/program/src/program_stubs.rs index 7fd31358090118..e06f6b1d201a42 100644 --- a/sdk/program/src/program_stubs.rs +++ b/sdk/program/src/program_stubs.rs @@ -8,7 +8,6 @@ use { program_error::UNSUPPORTED_SYSVAR, pubkey::Pubkey, }, base64::{prelude::BASE64_STANDARD, Engine}, - itertools::Itertools, std::sync::{Arc, RwLock}, }; @@ -114,7 +113,11 @@ pub trait SyscallStubs: Sync + Send { fn sol_log_data(&self, fields: &[&[u8]]) { println!( "data: {}", - fields.iter().map(|v| BASE64_STANDARD.encode(v)).join(" ") + fields + .iter() + .map(|v| BASE64_STANDARD.encode(v)) + .collect::>() + .join(" ") ); } fn sol_get_processed_sibling_instruction(&self, _index: usize) -> Option {