Skip to content

Commit

Permalink
add solana-define-syscall dep
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Feb 10, 2025
1 parent 485224d commit 4befd2d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ five8_const = "0.1.3"
pinocchio = { path = "sdk/pinocchio", version = ">= 0.6, <= 0.7" }
pinocchio-cpi = { path = "sdk/cpi", version = "0.1.0" }
pinocchio-pubkey = { path = "sdk/pubkey", version = "0.2.1" }
solana-define-syscall = "2.2.0"

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
Expand Down
3 changes: 3 additions & 0 deletions sdk/cpi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ std = []
[dependencies]
pinocchio = { workspace = true }

[target.'cfg(target_os = "solana")'.dependencies]
solana-define-syscall = { workspace = true }

[lints]
workspace = true
6 changes: 3 additions & 3 deletions sdk/cpi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ pub unsafe fn invoke_signed_unchecked(
{
let instruction = CInstruction::from(instruction);
unsafe {
crate::syscalls::sol_invoke_signed_c(
solana_define_syscall::definitions::sol_invoke_signed_c(
&instruction as *const _ as *const u8,
accounts as *const _ as *const u8,
accounts.len() as u64,
Expand All @@ -240,7 +240,7 @@ pub const MAX_RETURN_DATA: usize = 1024;
pub fn set_return_data(data: &[u8]) {
#[cfg(target_os = "solana")]
unsafe {
crate::syscalls::sol_set_return_data(data.as_ptr(), data.len() as u64)
solana_define_syscall::definitions::sol_set_return_data(data.as_ptr(), data.len() as u64)
};

#[cfg(not(target_os = "solana"))]
Expand Down Expand Up @@ -284,7 +284,7 @@ pub fn get_return_data() -> Option<ReturnData> {
let mut program_id = Pubkey::default();

let size = unsafe {
crate::syscalls::sol_get_return_data(
solana_define_syscall::definitions::sol_get_return_data(
data.as_mut_ptr() as *mut u8,
data.len() as u64,
&mut program_id,
Expand Down

0 comments on commit 4befd2d

Please sign in to comment.