Skip to content

Commit

Permalink
Fork Token 2022 program
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Oct 12, 2021
1 parent 12732f8 commit 1c417ff
Show file tree
Hide file tree
Showing 15 changed files with 8,898 additions and 9 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ members = [
"token-swap/program/fuzz",
"token/cli",
"token/program",
"token/program-2022",
"utils/cgen",
"utils/test-client",
"token-lending/flash_loan_receiver",
Expand Down
32 changes: 24 additions & 8 deletions ci/cargo-test-bpf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,33 @@ if [[ -z $program_directory ]]; then
usage "No program directory provided"
fi

set -x

cd $program_directory
run_dir=$(pwd)

if [[ -d $run_dir/program ]]; then
# Build/test just one BPF program
cd $run_dir/program
cargo +"$rust_stable" test-bpf -- --nocapture
else
# Build/test all BPF programs
if [[ -r $run_dir/Cargo.toml ]]; then
# Build/test just one BPF program
set -x
cd $run_dir
cargo +"$rust_stable" test-bpf -- --nocapture
exit 0
fi

run_all=1
for program in $run_dir/program{,-*}; do
# Build/test all program directories
if [[ -r $program/Cargo.toml ]]; then
run_all=
(
set -x
cd $program
cargo +"$rust_stable" test-bpf -- --nocapture
)
fi
done

if [[ -n $run_all ]]; then
# Build/test all directories
set -x
for directory in $(ls -d $run_dir/*/); do
cd $directory
cargo +"$rust_stable" test-bpf -- --nocapture
Expand Down
2 changes: 1 addition & 1 deletion ci/solana-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [[ -n $1 ]]; then
solana --version
;;
*)
echo "$0: Note: ignoring unknown argument: $1" >&2
echo "solana-version.sh: Note: ignoring unknown argument: $1" >&2
;;
esac
fi
29 changes: 29 additions & 0 deletions token/program-2022/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "spl-token-2022"
version = "0.1.0"
description = "Solana Program Library Token 2022"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana-program-library"
license = "Apache-2.0"
edition = "2018"
exclude = ["js/**"]

[features]
no-entrypoint = []

[dependencies]
arrayref = "0.3.6"
num-derive = "0.3"
num-traits = "0.2"
num_enum = "0.5.4"
solana-program = "1.8.0"
thiserror = "1.0"

[dev-dependencies]
solana-sdk = "1.8.0"

[lib]
crate-type = ["cdylib", "lib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
2 changes: 2 additions & 0 deletions token/program-2022/Xargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.bpfel-unknown-unknown.dependencies.std]
features = []
Loading

0 comments on commit 1c417ff

Please sign in to comment.