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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,801 changes: 1,393 additions & 1,408 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ check-cfg = [
]

[workspace.metadata.cli]
solana = "2.3.4"
solana = "3.0.0"

# Specify Rust toolchains for rustfmt, clippy, and build.
# Any unprovided toolchains default to stable.
Expand All @@ -33,13 +33,13 @@ tag-message = "Publish {{crate_name}} v{{version}}"
consolidate-commits = false

[workspace.dependencies]
mollusk-svm = "0.4.0"
mollusk-svm-fuzz-fixture = "0.4.0"
mollusk-svm = "0.6.3"
mollusk-svm-fuzz-fixture = "0.6.3"
num-traits = "0.2"
pinocchio = "0.9.2"
solana-instruction = "2.3.0"
solana-program-error = "2.2.2"
solana-program-option = "2.2.1"
solana-program-pack = "2.2.1"
solana-pubkey = "2.4.0"
solana-system-interface = { version="1.0", features=["bincode"] }
solana-instruction = "3.0.0"
solana-program-error = "3.0.0"
solana-program-option = "3.0.0"
solana-program-pack = "3.0.0"
solana-pubkey = "3.0.0"
solana-system-interface = { version = "2.0", features=["bincode"] }
24 changes: 12 additions & 12 deletions pinocchio/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ pinocchio-log = { version = "0.5.1", default-features = false }
pinocchio-token-interface = { version = "^0", path = "../interface" }

[dev-dependencies]
agave-feature-set = "2.2.20"
agave-feature-set = "3.0.0"
assert_matches = "1.5.0"
mollusk-svm = { workspace = true }
mollusk-svm-fuzz-fixture = { workspace = true }
num-traits = { workspace = true }
solana-account = "2.2.1"
solana-account = "3.0.0"
solana-instruction = { workspace = true }
solana-keypair = "2.2.3"
solana-keypair = "3.0.0"
solana-program-error = { workspace = true }
solana-program-option = { workspace = true }
solana-program-pack = { workspace = true }
solana-program-test = "2.3.4"
solana-program-test = "3.0.0"
solana-pubkey = { workspace = true }
solana-rent = "2.2.1"
solana-sdk-ids = "2.2.1"
solana-signature = "2.3.0"
solana-signer = "2.2.1"
solana-transaction = "2.2.3"
solana-transaction-error = "2.2.1"
solana-rent = "3.0.0"
solana-sdk-ids = "3.0.0"
solana-signature = "3.0.0"
solana-signer = "3.0.0"
solana-transaction = "3.0.0"
solana-transaction-error = "3.0.0"
solana-system-interface = { workspace = true }
spl-token-interface = "1"
spl-token-2022-interface = "1"
spl-token-interface = "2"
spl-token-2022-interface = "2"

[lints]
workspace = true
12 changes: 7 additions & 5 deletions pinocchio/program/tests/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,15 @@ fn create_token_account(
}

/// Creates a Mollusk instance with the default feature set, excluding the
/// `bpf_account_data_direct_mapping` feature.
/// `account_data_direct_mapping` feature.
fn mollusk() -> Mollusk {
let feature_set = {
let mut fs = FeatureSet::all_enabled();
fs.active_mut()
.remove(&agave_feature_set::bpf_account_data_direct_mapping::id());
fs
// When upgrading to v3.1, add this back in
//let fs = FeatureSet::all_enabled();
//fs.active_mut()
// .remove(&agave_feature_set::account_data_direct_mapping::id());
//fs
FeatureSet::all_enabled()
};
let mut mollusk = Mollusk {
feature_set,
Expand Down
31 changes: 15 additions & 16 deletions program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ bytemuck = "1.20.0"
num-derive = "0.4"
num-traits = { workspace = true }
num_enum = "0.7.3"
solana-account-info = "2.3.0"
solana-cpi = "2.2.1"
solana-account-info = "3.0.0"
solana-cpi = "3.0.0"
solana-instruction = { workspace = true }
solana-msg = "2.2.1"
solana-program-entrypoint = "2.3.0"
solana-msg = "3.0.0"
solana-program-entrypoint = "3.0.0"
solana-program-error = { workspace = true }
solana-program-memory = "2.3.1"
solana-program-memory = "3.0.0"
solana-program-option = { workspace = true }
solana-program-pack = { workspace = true }
solana-pubkey = { workspace = true, features = ["bytemuck"] }
solana-rent = "2.2.1"
solana-sdk-ids = "2.2.1"
solana-sysvar = { version = "2.2.2", features = ["bincode"] }
spl-token-interface = { version = "1.0" }
solana-rent = "3.0.0"
solana-sdk-ids = "3.0.0"
solana-sysvar = { version = "3.0.0", features = ["bincode"] }
spl-token-interface = { version = "2.0" }
thiserror = "2.0"

[dev-dependencies]
Expand All @@ -39,13 +39,12 @@ mollusk-svm = { workspace = true }
mollusk-svm-fuzz-fixture = { workspace = true }
proptest = "1.5"
serial_test = "3.2.0"
solana-account = "2.2.1"
solana-account-info = "2.3.0"
solana-clock = "2.2.2"
solana-native-token = "2.2.1"
solana-program-entrypoint = "2.3.0"
solana-rent = { version = "2.2.1", features = ["sysvar"] }
solana-system-interface = { version="1.0", features=["bincode"] }
solana-account = "3.0.0"
solana-account-info = "3.0.0"
solana-clock = "3.0.0"
solana-native-token = "3.0.0"
solana-rent = { version = "3.0.0", features = ["sysvar"] }
solana-system-interface = { version = "2.0", features=["bincode"] }
strum = "0.24"
strum_macros = "0.24"

Expand Down
7 changes: 2 additions & 5 deletions program/src/entrypoint.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
//! Program entrypoint

use {
crate::processor::Processor,
solana_account_info::AccountInfo,
solana_msg::msg,
solana_program_error::{ProgramResult, ToStr},
solana_pubkey::Pubkey,
crate::processor::Processor, solana_account_info::AccountInfo, solana_msg::msg,
solana_program_error::ProgramResult, solana_pubkey::Pubkey,
spl_token_interface::error::TokenError,
};

Expand Down
1 change: 0 additions & 1 deletion program/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![allow(clippy::arithmetic_side_effects)]
#![deny(missing_docs)]
#![cfg_attr(not(test), forbid(unsafe_code))]

//! An ERC20-like Token program for the Solana blockchain

Expand Down
15 changes: 6 additions & 9 deletions program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use {
solana_pubkey::{Pubkey, PUBKEY_BYTES},
solana_rent::Rent,
solana_sdk_ids::system_program,
solana_sysvar::Sysvar,
solana_sysvar::{Sysvar, SysvarSerialize},
};

/// Program state handler.
Expand Down Expand Up @@ -976,7 +976,7 @@ impl Processor {
/// Checks two pubkeys for equality in a computationally cheap way using
/// `sol_memcmp`
pub fn cmp_pubkeys(a: &Pubkey, b: &Pubkey) -> bool {
sol_memcmp(a.as_ref(), b.as_ref(), PUBKEY_BYTES) == 0
unsafe { sol_memcmp(a.as_ref(), b.as_ref(), PUBKEY_BYTES) == 0 }
}

/// Validates owner(s) are present
Expand Down Expand Up @@ -1025,23 +1025,23 @@ fn delete_account(account_info: &AccountInfo) -> Result<(), ProgramError> {
account_info.assign(&system_program::id());
let mut account_data = account_info.data.borrow_mut();
let data_len = account_data.len();
solana_program_memory::sol_memset(*account_data, 0, data_len);
unsafe {
solana_program_memory::sol_memset(*account_data, 0, data_len);
}
Ok(())
}

/// Helper function to totally delete an account on-chain
#[cfg(target_os = "solana")]
fn delete_account(account_info: &AccountInfo) -> Result<(), ProgramError> {
account_info.assign(&system_program::id());
account_info.realloc(0, false)
account_info.resize(0)
}

#[cfg(test)]
mod tests {
use {
super::*,
solana_clock::Epoch,
solana_program_error::ToStr,
std::sync::{Arc, RwLock},
};

Expand Down Expand Up @@ -1201,7 +1201,6 @@ mod tests {
&mut signer_data,
&program_id,
false,
Epoch::default(),
);
MAX_SIGNERS + 1
];
Expand All @@ -1224,7 +1223,6 @@ mod tests {
&mut data,
&program_id,
false,
Epoch::default(),
);

// full 11 of 11
Expand Down Expand Up @@ -1326,7 +1324,6 @@ mod tests {
&mut signer_data,
&program_id,
false,
Epoch::default(),
);
MAX_SIGNERS + 1
];
Expand Down
2 changes: 1 addition & 1 deletion program/tests/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn do_process_instruction_dups(
data: account_info.try_borrow_data().unwrap().to_vec(),
owner: *account_info.owner,
executable: account_info.executable,
rent_epoch: account_info.rent_epoch,
rent_epoch: u64::MAX,
};
dedup_accounts.push((*account_info.key, account));
cached_accounts.insert(account_info.key, account_info);
Expand Down