Skip to content

Commit

Permalink
extract solana-cpi crate (#2981)
Browse files Browse the repository at this point in the history
* extract cpi crate

* unused import

* fmt

* move sol_invoke_signed_c to cpi crate

* minimize solana_program use in doc comment

Co-authored-by: Jon C <[email protected]>

* minimize solana_program use in doc comment

Co-authored-by: Jon C <[email protected]>

* fix doc link

Co-authored-by: Jon C <[email protected]>

* fix entrypoint usage in doc examples

* add static assertion for inlined SUCCESS const (needed to remove #[cfg(target_os = "solana")] for this to work)

* fix doc link

Co-authored-by: Jon C <[email protected]>

* sort deps

---------

Co-authored-by: Jon C <[email protected]>
  • Loading branch information
kevinheavey and joncinque authored Oct 25, 2024
1 parent 51f3ba8 commit 7d455b0
Show file tree
Hide file tree
Showing 9 changed files with 507 additions and 298 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ members = [
"sdk/cargo-build-sbf",
"sdk/cargo-test-sbf",
"sdk/clock",
"sdk/cpi",
"sdk/decode-error",
"sdk/derivation-path",
"sdk/epoch-schedule",
Expand Down Expand Up @@ -406,6 +407,7 @@ solana-config-program = { path = "programs/config", version = "=2.1.0" }
solana-connection-cache = { path = "connection-cache", version = "=2.1.0", default-features = false }
solana-core = { path = "core", version = "=2.1.0" }
solana-cost-model = { path = "cost-model", version = "=2.1.0" }
solana-cpi = { path = "sdk/cpi", version = "=2.1.0" }
solana-curve25519 = { path = "curves/curve25519", version = "=2.1.0" }
solana-decode-error = { path = "sdk/decode-error", version = "=2.1.0" }
solana-define-syscall = { path = "define-syscall", version = "=2.1.0" }
Expand Down
13 changes: 13 additions & 0 deletions programs/sbf/Cargo.lock

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

31 changes: 31 additions & 0 deletions sdk/cpi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[package]
name = "solana-cpi"
description = "Solana Cross-program Invocation"
documentation = "https://docs.rs/solana-cpi"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }

[dependencies]
solana-account-info = { workspace = true }
solana-instruction = { workspace = true }
solana-program-error = { workspace = true }
solana-pubkey = { workspace = true }

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

[dev-dependencies]
solana-program = { path = "../program" }
solana-program-entrypoint = { workspace = true }
static_assertions = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
Loading

0 comments on commit 7d455b0

Please sign in to comment.