Skip to content

Commit ea98410

Browse files
committed
add rent pinocchio example
1 parent c1be751 commit ea98410

File tree

11 files changed

+1554
-1
lines changed

11 files changed

+1554
-1
lines changed

Cargo.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ members = [
3030
"basics/realloc/native/program",
3131
"basics/realloc/anchor/programs/*",
3232
"basics/rent/native/program",
33+
"basics/rent/pinocchio/program",
3334
"basics/rent/anchor/programs/*",
3435
"basics/favorites/native/program",
3536
"basics/repository-layout/native/program",

basics/rent/native/program/tests/test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ fn test_rent() {
2424
accounts: vec![
2525
AccountMeta::new(payer.pubkey(), true),
2626
AccountMeta::new(new_keypair.pubkey(), true),
27-
AccountMeta::new(payer.pubkey(), true),
2827
AccountMeta::new(solana_system_interface::program::ID, false),
2928
],
3029
data: [0_u8; 1000].to_vec(),

basics/rent/pinocchio/cicd.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# This script is for quick building & deploying of the program.
4+
# It also serves as a reference for the commands used for building & deploying Solana programs.
5+
# Run this bad boy with "bash cicd.sh" or "./cicd.sh"
6+
7+
cargo build-sbf --manifest-path=./program/Cargo.toml --bpf-out-dir=./program/target/so
8+
solana program deploy ./program/target/so/program.so

basics/rent/pinocchio/package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"type": "module",
3+
"scripts": {
4+
"test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/test.ts",
5+
"build-and-test": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./tests/fixtures && pnpm test",
6+
"build": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so",
7+
"deploy": "solana program deploy ./program/target/so/program.so"
8+
},
9+
"dependencies": {
10+
"@solana/web3.js": "^1.47.3",
11+
"borsh": "^0.7.0",
12+
"buffer": "^6.0.3",
13+
"fs": "^0.0.1-security"
14+
},
15+
"devDependencies": {
16+
"@types/bn.js": "^5.1.0",
17+
"@types/chai": "^4.3.1",
18+
"@types/mocha": "^9.1.1",
19+
"chai": "^4.3.4",
20+
"mocha": "^9.0.3",
21+
"solana-bankrun": "^0.3.0",
22+
"ts-mocha": "^10.0.0",
23+
"typescript": "^4.3.5"
24+
}
25+
}

0 commit comments

Comments
 (0)