Skip to content
Open
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: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,7 @@ solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
solana-transaction-error = "3.2.0"
solana-native-token = "3.0.0"
solana-rent = "4.1.0"
solana-address = "2.6.0"
10 changes: 5 additions & 5 deletions basics/account-data/native/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ custom-panic = []
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-keypair = "3.0.1"
litesvm.workspace = true
solana-keypair.workspace = true
solana-message = "4.0.0"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-signer = "3.0.0"
solana-transaction = "3.0.1"
solana-transaction.workspace = true
10 changes: 5 additions & 5 deletions basics/account-data/pinocchio/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ pinocchio-log.workspace = true
pinocchio-system.workspace = true

[dev-dependencies]
litesvm = "0.11.0"
solana-keypair = "3.0.1"
litesvm.workspace = true
solana-keypair.workspace = true
solana-message = "4.0.0"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-signer = "3.0.0"
solana-transaction = "3.0.1"
solana-transaction.workspace = true
solana-system-interface.workspace = true

[lib]
Expand Down
14 changes: 7 additions & 7 deletions basics/checking-accounts/asm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ edition = "2021"
[dependencies]

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
solana-system-interface.workspace = true
solana-transaction-error = "3.2.0"
solana-transaction-error.workspace = true

[features]
test-sbf = []
10 changes: 5 additions & 5 deletions basics/checking-accounts/native/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ custom-panic = []
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
litesvm.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-sdk = "4.0.1"
solana-transaction = "3.0.1"
solana-transaction.workspace = true
10 changes: 5 additions & 5 deletions basics/checking-accounts/pinocchio/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ pinocchio-system.workspace = true
pinocchio-log.workspace = true

[dev-dependencies]
litesvm = "0.11.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
litesvm.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-sdk = "4.0.1"
solana-transaction = "3.0.1"
solana-transaction.workspace = true
solana-system-interface.workspace = true

[lib]
Expand Down
12 changes: 6 additions & 6 deletions basics/close-account/native/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ custom-panic = []
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
10 changes: 5 additions & 5 deletions basics/close-account/pinocchio/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ pinocchio-pubkey.workspace = true
pinocchio-system.workspace = true

[dev-dependencies]
litesvm = "0.11.0"
solana-keypair = "3.0.1"
litesvm.workspace = true
solana-keypair.workspace = true
solana-message = "4.0.0"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-signer = "3.0.0"
solana-transaction = "3.0.1"
solana-transaction.workspace = true
solana-system-interface.workspace = true
solana-instruction.workspace = true

Expand Down
14 changes: 7 additions & 7 deletions basics/counter/native/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ solana-program.workspace = true
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
solana-rent = "4.1.0"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
solana-rent.workspace = true
solana-system-interface.workspace = true
14 changes: 7 additions & 7 deletions basics/counter/pinocchio/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ pinocchio-pubkey.workspace = true
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
solana-rent = "4.1.0"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
solana-rent.workspace = true
solana-system-interface.workspace = true
12 changes: 6 additions & 6 deletions basics/create-account/asm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ edition = "2021"
[dependencies]

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
solana-system-interface.workspace = true

[features]
Expand Down
12 changes: 6 additions & 6 deletions basics/create-account/native/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ custom-panic = []
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
12 changes: 6 additions & 6 deletions basics/create-account/pinocchio/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ custom-panic = []
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
solana-system-interface.workspace = true
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ custom-heap = []
custom-panic = []

[dependencies]
borsh = "1.5.7"
borsh-derive = "1.5.7"
solana-program = "3.0"
borsh = "1.6.1"
borsh-derive = "1.6.1"
solana-program = "4.0"
cross-program-invocatio-native-lever = { path = "../lever", features = ["cpi"] }

[lib]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ custom-heap = []
custom-panic = []

[dependencies]
borsh = "1.5.7"
borsh-derive = "1.5.7"
solana-program = "3.0"
borsh = "1.6.1"
borsh-derive = "1.6.1"
solana-program = "4.0"
solana-system-interface = {version = "2.0.0", features = ["bincode"]}

[lib]
Expand Down
12 changes: 6 additions & 6 deletions basics/favorites/native/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ custom-panic = []
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
16 changes: 8 additions & 8 deletions basics/favorites/native/tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Transaction,
TransactionInstruction,
} from "@solana/web3.js";
import { BN } from "bn.js";
import * as borsh from "borsh";
import { assert, expect } from "chai";
import { describe, test } from "mocha";
Expand Down Expand Up @@ -103,15 +102,15 @@ describe("Favorites Solana Native", () => {

console.log("Deserialized data:", favoritesData);

expect(new BN(favoritesData.number as Buffer, "le").toNumber()).to.equal(favData.number);
expect(Number(favoritesData.number)).to.equal(favData.number);
expect(favoritesData.color).to.equal(favData.color);
expect(favoritesData.hobbies).to.deep.equal(favData.hobbies);
});

test("Check if the test fails if the pda seeds aren't same", async () => {
// We put the wrong seeds knowingly to see if the test fails because of checks
const favoritesPda = PublicKey.findProgramAddressSync(
[Buffer.from("favorite"), payer.publicKey.toBuffer()],
// Derive a PDA using WRONG seeds so the program's on-chain seed check rejects it
const wrongPda = PublicKey.findProgramAddressSync(
[Buffer.from("wrong_seed"), payer.publicKey.toBuffer()],
programId,
)[0];
const favData = {
Expand All @@ -124,7 +123,7 @@ describe("Favorites Solana Native", () => {
const ix = new TransactionInstruction({
keys: [
{ pubkey: payer.publicKey, isSigner: true, isWritable: true },
{ pubkey: favoritesPda, isSigner: false, isWritable: true },
{ pubkey: wrongPda, isSigner: false, isWritable: true },
{ pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
],
programId,
Expand All @@ -136,12 +135,13 @@ describe("Favorites Solana Native", () => {
tx.recentBlockhash = blockhash;
tx.sign(payer);
tx.recentBlockhash = blockhash;
let threw = false;
try {
await client.processTransaction(tx);
console.error("Expected the test to fail");
} catch (_err) {
assert(true);
threw = true;
}
assert(threw, "Expected transaction to fail with wrong PDA seeds");
});

test("Get the favorite pda and cross-check the data", async () => {
Expand Down
12 changes: 6 additions & 6 deletions basics/favorites/pinocchio/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ custom-panic = []
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
solana-system-interface.workspace = true
12 changes: 6 additions & 6 deletions basics/hello-solana/native/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ custom-panic = []
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-native-token = "3.0.0"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-native-token.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
12 changes: 6 additions & 6 deletions basics/processing-instructions/native/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ custom-panic = []
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
solana-native-token = "3.0.0"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
solana-native-token.workspace = true
12 changes: 6 additions & 6 deletions basics/processing-instructions/pinocchio/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ custom-panic = []
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.1"
solana-native-token = "3.0.0"
litesvm.workspace = true
solana-instruction.workspace = true
solana-keypair.workspace = true
solana-pubkey.workspace = true
solana-transaction.workspace = true
solana-native-token.workspace = true
Loading