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 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ light-sdk-pinocchio = { path = "sdk-libs/sdk-pinocchio", version = "0.17.1" }
light-sdk-macros = { path = "sdk-libs/macros", version = "0.17.1" }
light-sdk-types = { path = "sdk-libs/sdk-types", version = "0.17.1", default-features = false }
light-compressed-account = { path = "program-libs/compressed-account", version = "0.7.0", default-features = false }
light-compressible = { path = "program-libs/compressible", version = "0.2.0" }
light-compressible = { path = "program-libs/compressible", version = "0.2.0", default-features = false }
light-compressible-client = { path = "sdk-libs/compressible-client", version = "0.17.1" }
light-token-interface = { path = "program-libs/token-interface", version = "0.1.0" }
light-account-checks = { path = "program-libs/account-checks", version = "0.6.0", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion forester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ light-client = { workspace = true, features = ["v2"] }
light-merkle-tree-metadata = { workspace = true }
light-sdk = { workspace = true, features = ["anchor"] }
light-program-test = { workspace = true }
light-compressible = { workspace = true }
light-compressible = { workspace = true, default-features = false, features = ["solana"] }
light-token-interface = { workspace = true }
light-token-sdk = { workspace = true }
solana-rpc-client-api = { workspace = true }
Expand Down
10 changes: 5 additions & 5 deletions program-libs/compressible/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ description = "Light Protocol compressible data structures"
license = "MIT"

[features]
default = ["pinocchio", "solana"]
solana = ["dep:solana-program-error", "light-compressed-account/solana", "solana-sysvar", "solana-msg"]
anchor = ["anchor-lang", "light-compressed-account/anchor", "light-compressed-account/std"]
pinocchio = ["light-compressed-account/pinocchio"]
default = ["solana"]
solana = ["dep:solana-program-error", "light-compressed-account/solana", "light-account-checks/solana", "solana-sysvar", "solana-msg"]
anchor = ["anchor-lang", "light-compressed-account/anchor", "light-compressed-account/std", "light-account-checks/solana"]
pinocchio = ["dep:pinocchio", "light-compressed-account/pinocchio", "light-account-checks/pinocchio"]
profile-program = []
profile-heap = ["dep:light-heap"]

Expand All @@ -19,7 +19,7 @@ zerocopy = { workspace = true, features = ["derive"] }
light-hasher = { workspace = true }
light-zero-copy = { workspace = true, features = ["std", "mut", "derive"] }
light-macros = { workspace = true }
pinocchio = { workspace = true }
pinocchio = { workspace = true, optional = true }
solana-program-error = { workspace = true, optional = true }
solana-msg = { workspace = true, optional = true }
# Feature-gated dependencies
Expand Down
5 changes: 2 additions & 3 deletions program-libs/compressible/src/compression_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use aligned_sized::aligned_sized;
use bytemuck::{Pod, Zeroable};
use light_program_profiler::profile;
use light_zero_copy::{ZeroCopy, ZeroCopyMut};
use pinocchio::pubkey::Pubkey;
use zerocopy::U64;

use crate::{
Expand Down Expand Up @@ -163,8 +162,8 @@ impl_get_last_paid_epoch!(ZCompressionInfo<'_>);
impl_get_last_paid_epoch!(ZCompressionInfoMut<'_>);

pub struct ClaimAndUpdate<'a> {
pub compression_authority: &'a Pubkey,
pub rent_sponsor: &'a Pubkey,
pub compression_authority: &'a [u8; 32],
pub rent_sponsor: &'a [u8; 32],
pub config_account: &'a CompressibleConfig,
pub bytes: u64,
pub current_slot: u64,
Expand Down
13 changes: 10 additions & 3 deletions program-libs/compressible/src/rent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@ use crate::error::CompressibleError;

#[track_caller]
pub fn get_rent_exemption_lamports(_num_bytes: u64) -> Result<u64, CompressibleError> {
#[cfg(target_os = "solana")]
#[cfg(all(target_os = "solana", feature = "pinocchio"))]
{
use pinocchio::sysvars::Sysvar;
return pinocchio::sysvars::rent::Rent::get()
.map(|rent| rent.minimum_balance(_num_bytes as usize))
.map_err(|_| CompressibleError::FailedBorrowRentSysvar);
}
#[cfg(not(target_os = "solana"))]
#[cfg(all(target_os = "solana", not(feature = "pinocchio"), feature = "solana"))]
{
use solana_sysvar::Sysvar;
return solana_sysvar::rent::Rent::get()
.map(|rent| rent.minimum_balance(_num_bytes as usize))
.map_err(|_| CompressibleError::FailedBorrowRentSysvar);
}
#[cfg(not(all(target_os = "solana", any(feature = "pinocchio", feature = "solana"))))]
{
unimplemented!(
"get_rent_exemption_lamports is only implemented for target os solana and tests"
"get_rent_exemption_lamports is only implemented for target os solana with pinocchio or solana feature"
)
}
}
2 changes: 1 addition & 1 deletion programs/compressed-token/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ light-account-checks = { workspace = true, features = ["solana", "pinocchio", "m
light-sdk = { workspace = true }
borsh = { workspace = true }
light-sdk-types = { workspace = true }
light-compressible = { workspace = true }
light-compressible = { workspace = true, features = ["pinocchio"] }
solana-pubkey = { workspace = true }
arrayvec = { workspace = true }
tinyvec = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion sdk-libs/token-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ profile-heap = [
[dependencies]
# Light Protocol dependencies
light-token-types = { workspace = true }
light-compressed-account = { workspace = true, features = ["std"] }
light-compressed-account = { workspace = true, features = ["std", "solana"] }
light-compressible = { workspace = true }
light-token-interface = { workspace = true }
light-sdk = { workspace = true, features = ["v2"] }
Expand Down