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
16 changes: 13 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Run unit tests'
run: cargo test --locked --workspace --exclude sol_rpc_int_tests
run: cargo test --locked --workspace --exclude basic_solana --exclude sol_rpc_int_tests

integration-tests:
needs: [ reproducible-build ]
Expand Down Expand Up @@ -107,8 +107,18 @@ jobs:
run: |
echo "WALLET_WASM_PATH=$GITHUB_WORKSPACE/wallet.wasm.gz" >> "$GITHUB_ENV"

- name: 'Cargo test'
run: cargo test --package sol_rpc_int_tests -- --test-threads 2 --nocapture
- name: 'Set BASIC_SOLANA_WASM_PATH for load_wasm'
run: |
echo "BASIC_SOLANA_WASM_PATH=$GITHUB_WORKSPACE/target/wasm32-unknown-unknown/canister-release/basic_solana.wasm" >> "$GITHUB_ENV"

- name: 'Test basic_solana'
run: |
cargo build --manifest-path examples/basic_solana/Cargo.toml --target wasm32-unknown-unknown --no-default-features --profile canister-release
cargo test --locked --package basic_solana


- name: 'Test sol_rpc_int_tests'
run: cargo test --locked --package sol_rpc_int_tests -- --test-threads 2 --nocapture

end-to-end-tests:
needs: [ reproducible-build ]
Expand Down
6 changes: 6 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 @@ -76,6 +76,7 @@ solana-program = "2.2.0"
solana-pubkey = "2.2.0"
solana-reward-info = "2.2.0"
solana-rpc-client-api = "2.2.0"
solana-rpc-client-nonce-utils = "2.2.0"
solana-signature = "2.2.0"
solana-signer = "2.2.0"
solana-transaction = "2.2.0"
Expand Down Expand Up @@ -109,6 +110,7 @@ solana-program = { git = "https://github.com/dfinity/agave", tag = "323039e-js-f
solana-pubkey = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-reward-info = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-rpc-client-api = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-rpc-client-nonce-utils = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-signer = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-signature = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-transaction = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
Expand Down
14 changes: 12 additions & 2 deletions examples/basic_solana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name = "basic_solana"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]
[[bin]]
name = "basic_solana"
path = "src/main.rs"

[dependencies]
base64 = "0.22.1"
Expand All @@ -30,3 +31,12 @@ solana-program = { workspace = true }
solana-pubkey = { workspace = true }
solana-signature = { workspace = true }
solana-transaction = { workspace = true, features = ["bincode"] }

[dev-dependencies]
candid = { workspace = true }
candid_parser = { workspace = true }
ic-test-utilities-load-wasm = { workspace = true }
pocket-ic = { workspace = true }
solana-client = { workspace = true }
solana-commitment-config = { workspace = true }
solana-rpc-client-nonce-utils = {workspace = true}
5 changes: 4 additions & 1 deletion examples/basic_solana/basic_solana.did
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ type Address = text;
// A transaction ID on Solana, i.e. the first signature in a transaction.
type Txid = text;

// Hash value used as recent_blockhash field in Transactions.
type Blockhash = text;

service : (InitArg) -> {
// Returns the Solana account derived from the owner principal.
//
Expand All @@ -62,7 +65,7 @@ service : (InitArg) -> {
// Returns the current blockhash for the given Solana nonce account.
//
// If no account is provided, the nonce account derived from the caller's principal is used.
get_nonce : (account: opt Address) -> (Lamport);
get_nonce : (account: opt Address) -> (Blockhash);

// Returns the balance of the given Solana account for the SPL token associated with
// the given token mint account. The balance is a floating point value and is formatted
Expand Down
Loading