Skip to content

Commit c193f58

Browse files
authored
add create account asm example (#549)
* add create account asm example * clean up * add asserts to tests * fix lamport bug and remove logs * Update lib.rs
1 parent 8d1f1a7 commit c193f58

12 files changed

Lines changed: 1734 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 15 additions & 2 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
@@ -17,6 +17,7 @@ members = [
1717
"basics/create-account/native/program",
1818
"basics/create-account/pinocchio/program",
1919
"basics/create-account/anchor/programs/create-system-account",
20+
"basics/create-account/asm",
2021
"basics/cross-program-invocation/anchor/programs/*",
2122
"basics/hello-solana/native/program",
2223
"basics/hello-solana/anchor/programs/*",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
build/**/*
2+
deploy/**/*
3+
node_modules
4+
.sbpf
5+
.DS_Store
6+
.vscode
7+
keypair.json
8+
package-lock.json
9+
test-ledger
10+
yarn.lock
11+
target
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[package]
2+
name = "create-account-asm-program"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
8+
[dev-dependencies]
9+
litesvm = "0.11.0"
10+
solana-instruction = "3.0.0"
11+
solana-keypair = "3.0.1"
12+
solana-native-token = "3.0.0"
13+
solana-pubkey = "3.0.0"
14+
solana-transaction = "3.0.1"
15+
solana-system-interface.workspace = true
16+
17+
[features]
18+
test-sbf = []
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# create-account-asm-program
2+
3+
Created with [sbpf](https://github.com/blueshift-gg/sbpf)

basics/create-account/asm/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+
sbpf build --deploy-dir ./tests/fixtures/
8+
solana program deploy ./tests/fixtures/create-account-asm-program.so
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"type": "module",
3+
"scripts": {
4+
"test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/test.ts",
5+
"build-and-test": "sbpf build --deploy-dir ./tests/fixtures && pnpm test",
6+
"build": "sbpf build --deploy-dir /tests/fixtures",
7+
"deploy": "solana program deploy ./test/fixtures/create-account-asm-program.so"
8+
},
9+
"dependencies": {
10+
"@solana/web3.js": "^1.47.3"
11+
},
12+
"devDependencies": {
13+
"@types/bn.js": "^5.1.0",
14+
"@types/chai": "^4.3.1",
15+
"@types/mocha": "^9.1.1",
16+
"chai": "^4.3.4",
17+
"mocha": "^9.0.3",
18+
"solana-bankrun": "^0.3.0",
19+
"ts-mocha": "^10.0.0",
20+
"typescript": "^4.3.5"
21+
}
22+
}

0 commit comments

Comments
 (0)